diff options
-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 | ||