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


Ignore:
File:
1 edited

Legend:

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

    r9a1d8ab r482dde7  
    424424                for (c = 0; c < BPS(bs) / sizeof(fat_cluster_t); c++, cl++) {
    425425                        /*
    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.
     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.
    430432                         */
    431                         if ((cl >= 2) &&
    432                             ((cl - 2) * SPC(bs) + SSA(bs) >= TS(bs))) {
     433                        if ((cl >= FAT_CLST_FIRST) &&
     434                            CLBN2PBN(bs, cl, SPC(bs) - 1) >= TS(bs)) {
    433435                                rc = block_put(blk);
    434436                                if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.