From 66bc3e1118029de33a1b28f37316fca9dfc4aa1e Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 9 Sep 2008 12:31:37 +0300 Subject: [PATCH] --- yaml --- r: 116206 b: refs/heads/master c: 403e12ab30ab160e1015bd998f0abc1865c574e0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ubifs/super.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f6e0d1b1adac..59620b9a59b4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: af2eb5637b88f7b8edf295ad3880706c5c30c324 +refs/heads/master: 403e12ab30ab160e1015bd998f0abc1865c574e0 diff --git a/trunk/fs/ubifs/super.c b/trunk/fs/ubifs/super.c index dae1c62156c6..7e1f3efdf632 100644 --- a/trunk/fs/ubifs/super.c +++ b/trunk/fs/ubifs/super.c @@ -418,6 +418,7 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) { struct ubifs_info *c = sb->s_fs_info; int i, ret = 0, err; + long long bud_bytes; if (c->jheads) for (i = 0; i < c->jhead_cnt; i++) { @@ -425,6 +426,17 @@ static int ubifs_sync_fs(struct super_block *sb, int wait) if (err && !ret) ret = err; } + + /* Commit the journal unless it has too few data */ + spin_lock(&c->buds_lock); + bud_bytes = c->bud_bytes; + spin_unlock(&c->buds_lock); + if (bud_bytes > c->leb_size) { + err = ubifs_run_commit(c); + if (err) + return err; + } + /* * We ought to call sync for c->ubi but it does not have one. If it had * it would in turn call mtd->sync, however mtd operations are