diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2009-09-19 12:31:58 -0400 |
---|---|---|
committer | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2009-09-19 12:35:25 -0400 |
commit | ed248b290da7297c9b9a3ff180f5eee4db016224 (patch) | |
tree | 86793695dccd8ff8e6973f546da0020964717534 /fs/fat/inode.c | |
parent | 955234755ce4a2c33cfc558912aa8f2148cc1fc6 (diff) |
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>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 63a5c1a4ee60..a8a3afec8758 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -451,12 +451,16 @@ static void fat_write_super(struct super_block *sb) | |||
451 | 451 | ||
452 | static int fat_sync_fs(struct super_block *sb, int wait) | 452 | static int fat_sync_fs(struct super_block *sb, int wait) |
453 | { | 453 | { |
454 | lock_super(sb); | 454 | int err = 0; |
455 | fat_clusters_flush(sb); | ||
456 | sb->s_dirt = 0; | ||
457 | unlock_super(sb); | ||
458 | 455 | ||
459 | return 0; | 456 | if (sb->s_dirt) { |
457 | lock_super(sb); | ||
458 | sb->s_dirt = 0; | ||
459 | err = fat_clusters_flush(sb); | ||
460 | unlock_super(sb); | ||
461 | } | ||
462 | |||
463 | return err; | ||
460 | } | 464 | } |
461 | 465 | ||
462 | static void fat_put_super(struct super_block *sb) | 466 | static void fat_put_super(struct super_block *sb) |