Commit 3eb14297 authored by Adrian Hunter's avatar Adrian Hunter Committed by Artem Bityutskiy

UBIFS: sync wbufs after syncing inodes and pages

All writes go through wbufs so they must be sync'd
after syncing inodes and pages.
Signed-off-by: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 4a29d200
...@@ -450,16 +450,6 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) ...@@ -450,16 +450,6 @@ static int ubifs_sync_fs(struct super_block *sb, int wait)
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
return 0; 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 * VFS calls '->sync_fs()' before synchronizing all dirty inodes and
* pages, so synchronize them first, then commit the journal. Strictly * pages, so synchronize them first, then commit the journal. Strictly
...@@ -471,6 +461,16 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) ...@@ -471,6 +461,16 @@ static int ubifs_sync_fs(struct super_block *sb, int wait)
*/ */
generic_sync_sb_inodes(sb, &wbc); 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); err = ubifs_run_commit(c);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment