diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2009-07-22 12:26:33 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-09-14 05:27:14 -0400 |
commit | 6233caa9d5b153c2190d6c1c35c1dd1010104fc1 (patch) | |
tree | 885fdeacf10bbbecebf94fc274bfd84ff28066f6 /fs/nilfs2/super.c | |
parent | ec5d66abdb0caf8b753a138568f20770a3d64c8c (diff) |
nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs
This fixes disorder of nilfs_write_super in nilfs_sync_fs. Commiting
super block must be the end of the function so that every changes are
reflected.
->sync_fs() is not called frequently so this makes nilfs_sync_fs call
nilfs_commit_super instead of nilfs_write_super.
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index e543eda0d939..9926a1d6d225 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -385,13 +385,19 @@ static void nilfs_write_super(struct super_block *sb) | |||
385 | 385 | ||
386 | static int nilfs_sync_fs(struct super_block *sb, int wait) | 386 | static int nilfs_sync_fs(struct super_block *sb, int wait) |
387 | { | 387 | { |
388 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | ||
389 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
388 | int err = 0; | 390 | int err = 0; |
389 | 391 | ||
390 | nilfs_write_super(sb); | ||
391 | |||
392 | /* This function is called when super block should be written back */ | 392 | /* This function is called when super block should be written back */ |
393 | if (wait) | 393 | if (wait) |
394 | err = nilfs_construct_segment(sb); | 394 | err = nilfs_construct_segment(sb); |
395 | |||
396 | down_write(&nilfs->ns_sem); | ||
397 | if (sb->s_dirt) | ||
398 | nilfs_commit_super(sbi, 1); | ||
399 | up_write(&nilfs->ns_sem); | ||
400 | |||
395 | return err; | 401 | return err; |
396 | } | 402 | } |
397 | 403 | ||