fat: Check s_dirt in fat_sync_fs()

If we didn't check sb->s_dirt, it will update the FSINFO
unconditionally. It will reduce the filetime of flash base device.

So, this checks sb->s_dirt. sb->s_dirt is racy, however FSINFO is just
hint. So even if there is race, and we hit it, it would not become big
problem.

And this also is as workaround of suspend problem.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
This commit is contained in:
OGAWA Hirofumi
2009-09-20 01:31:58 +09:00
parent 955234755c
commit ed248b290d
3 changed files with 15 additions and 9 deletions

View File

@@ -451,12 +451,16 @@ static void fat_write_super(struct super_block *sb)
static int fat_sync_fs(struct super_block *sb, int wait)
{
lock_super(sb);
fat_clusters_flush(sb);
sb->s_dirt = 0;
unlock_super(sb);
int err = 0;
return 0;
if (sb->s_dirt) {
lock_super(sb);
sb->s_dirt = 0;
err = fat_clusters_flush(sb);
unlock_super(sb);
}
return err;
}
static void fat_put_super(struct super_block *sb)