From: OGAWA Hirofumi The -1 was documented as "there is no hint", so this patch uses -1 instead of 0 for FAT32 fsinfo. fs/fat/inode.c | 2 +- fs/fat/misc.c | 2 +- include/linux/msdos_fs_sb.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff -puN fs/fat/inode.c~fat-06-fix-prev_free fs/fat/inode.c --- 25/fs/fat/inode.c~fat-06-fix-prev_free 2003-12-21 22:18:05.000000000 -0800 +++ 25-akpm/fs/fat/inode.c 2003-12-21 22:18:05.000000000 -0800 @@ -885,7 +885,7 @@ int fat_fill_super(struct super_block *s sbi->fat_length = CF_LE_W(b->fat_length); sbi->root_cluster = 0; sbi->free_clusters = -1; /* Don't know yet */ - sbi->prev_free = 0; + sbi->prev_free = -1; if (!sbi->fat_length && b->fat32_length) { struct fat_boot_fsinfo *fsinfo; diff -puN fs/fat/misc.c~fat-06-fix-prev_free fs/fat/misc.c --- 25/fs/fat/misc.c~fat-06-fix-prev_free 2003-12-21 22:18:05.000000000 -0800 +++ 25-akpm/fs/fat/misc.c 2003-12-21 22:18:05.000000000 -0800 @@ -74,7 +74,7 @@ void fat_clusters_flush(struct super_blo } else { if (sbi->free_clusters != -1) fsinfo->free_clusters = CF_LE_L(sbi->free_clusters); - if (sbi->prev_free) + if (sbi->prev_free != -1) fsinfo->next_cluster = CF_LE_L(sbi->prev_free); mark_buffer_dirty(bh); } diff -puN include/linux/msdos_fs_sb.h~fat-06-fix-prev_free include/linux/msdos_fs_sb.h --- 25/include/linux/msdos_fs_sb.h~fat-06-fix-prev_free 2003-12-21 22:18:05.000000000 -0800 +++ 25-akpm/include/linux/msdos_fs_sb.h 2003-12-21 22:18:05.000000000 -0800 @@ -49,7 +49,7 @@ struct msdos_sb_info { unsigned long root_cluster; /* first cluster of the root directory */ unsigned long fsinfo_sector; /* FAT32 fsinfo offset from start of disk */ struct semaphore fat_lock; - int prev_free; /* previously returned free cluster number */ + int prev_free; /* previously allocated cluster number */ int free_clusters; /* -1 if undefined */ struct fat_mount_options options; struct nls_table *nls_disk; /* Codepage used on disk */ _