From 4e7c75e06a3af9e04c42781b96e8f6918ba2677a Mon Sep 17 00:00:00 2001 From: Hirofumi Ogawa Date: Tue, 19 Oct 2004 18:16:30 -0700 Subject: [PATCH] [PATCH] FAT: check free_clusters value This patch make sure it's <= sbi->clusters. Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/fat/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 2673d8779cdc5..ea904da486c68 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -997,6 +997,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, } 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); -- 2.53.0