Changes in / [482dde7:9a1d8ab] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.c

    r482dde7 r9a1d8ab  
    424424                for (c = 0; c < BPS(bs) / sizeof(fat_cluster_t); c++, cl++) {
    425425                        /*
    426                          * Check if the entire cluster is physically there.
    427                          * This check becomes necessary when the file system is
    428                          * created with fewer total sectors than how many is
    429                          * inferred from the size of the file allocation table
    430                          * or when the last cluster ends beyond the end of the
    431                          * device.
     426                         * Check if the cluster is physically there. This check
     427                         * becomes necessary when the file system is created
     428                         * with fewer total sectors than how many is inferred
     429                         * from the size of the file allocation table.
    432430                         */
    433                         if ((cl >= FAT_CLST_FIRST) &&
    434                             CLBN2PBN(bs, cl, SPC(bs) - 1) >= TS(bs)) {
     431                        if ((cl >= 2) &&
     432                            ((cl - 2) * SPC(bs) + SSA(bs) >= TS(bs))) {
    435433                                rc = block_put(blk);
    436434                                if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.