mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
UBIFS: do not commit twice
VFS calls '->sync_fs()' twice - first time with @wait = 0, second time with @wait = 1. As a result, we may commit and synchronize write-buffers twice. Avoid doing this by returning immediatelly if @wait = 0. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
1de9e8e70f
commit
dedb0d48a9
1 changed files with 5 additions and 4 deletions
|
@ -432,18 +432,19 @@ static int ubifs_sync_fs(struct super_block *sb, int wait)
|
||||||
int i, err;
|
int i, err;
|
||||||
struct ubifs_info *c = sb->s_fs_info;
|
struct ubifs_info *c = sb->s_fs_info;
|
||||||
struct writeback_control wbc = {
|
struct writeback_control wbc = {
|
||||||
.sync_mode = wait ? WB_SYNC_ALL : WB_SYNC_NONE,
|
.sync_mode = WB_SYNC_ALL,
|
||||||
.range_start = 0,
|
.range_start = 0,
|
||||||
.range_end = LLONG_MAX,
|
.range_end = LLONG_MAX,
|
||||||
.nr_to_write = LONG_MAX,
|
.nr_to_write = LONG_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note by akpm about WB_SYNC_NONE used above: zero @wait is just an
|
* Zero @wait is just an advisory thing to help the file system shove
|
||||||
* advisory thing to help the file system shove lots of data into the
|
* lots of data into the queues, and there will be the second
|
||||||
* queues. If some gets missed then it'll be picked up on the second
|
|
||||||
* '->sync_fs()' call, with non-zero @wait.
|
* '->sync_fs()' call, with non-zero @wait.
|
||||||
*/
|
*/
|
||||||
|
if (!wait)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (sb->s_flags & MS_RDONLY)
|
if (sb->s_flags & MS_RDONLY)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue