Commit 4e7c75e0 authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] FAT: check free_clusters value

This patch make sure it's <= sbi->clusters.
Signed-off-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4d1f8094
...@@ -997,6 +997,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, ...@@ -997,6 +997,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
} }
sbi->clusters = total_clusters; sbi->clusters = total_clusters;
/* check the free_clusters, it's not necessarily correct */
if (sbi->free_clusters != -1 && sbi->free_clusters > sbi->clusters)
sbi->free_clusters = -1;
brelse(bh); brelse(bh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment