Skip to content

Commit

Permalink
UBIFS: sync wbufs after syncing inodes and pages
Browse files Browse the repository at this point in the history
All writes go through wbufs so they must be sync'd
after syncing inodes and pages.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Adrian Hunter authored and Artem Bityutskiy committed Jan 29, 2009
1 parent 4a29d20 commit 3eb1429
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,6 @@ static int ubifs_sync_fs(struct super_block *sb, int wait)
if (sb->s_flags & MS_RDONLY)
return 0;

/*
* Synchronize write buffers, because 'ubifs_run_commit()' does not
* do this if it waits for an already running commit.
*/
for (i = 0; i < c->jhead_cnt; i++) {
err = ubifs_wbuf_sync(&c->jheads[i].wbuf);
if (err)
return err;
}

/*
* VFS calls '->sync_fs()' before synchronizing all dirty inodes and
* pages, so synchronize them first, then commit the journal. Strictly
Expand All @@ -471,6 +461,16 @@ static int ubifs_sync_fs(struct super_block *sb, int wait)
*/
generic_sync_sb_inodes(sb, &wbc);

/*
* Synchronize write buffers, because 'ubifs_run_commit()' does not
* do this if it waits for an already running commit.
*/
for (i = 0; i < c->jhead_cnt; i++) {
err = ubifs_wbuf_sync(&c->jheads[i].wbuf);
if (err)
return err;
}

err = ubifs_run_commit(c);
if (err)
return err;
Expand Down

0 comments on commit 3eb1429

Please sign in to comment.