summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/gc.c
diff options
context:
space:
mode:
authorArtem Bityutskiy2010-08-04 09:14:47 +0200
committerArtem Bityutskiy2010-08-30 09:19:06 +0200
commit5ffef88ffeb730e1bf2da56a39a55e03d57a66c9 (patch)
treea524f5806930d593d1f38f29f6a3e28948f8e851 /fs/ubifs/gc.c
parentLinux 2.6.36-rc3 (diff)
downloadkernel-qcow2-linux-5ffef88ffeb730e1bf2da56a39a55e03d57a66c9.tar.gz
kernel-qcow2-linux-5ffef88ffeb730e1bf2da56a39a55e03d57a66c9.tar.xz
kernel-qcow2-linux-5ffef88ffeb730e1bf2da56a39a55e03d57a66c9.zip
UBIFS: switch to RO mode after synchronizing
In 'ubifs_garbage_collect()' on error path, we first switch to R/O mode, and then synchronize write-buffers (to make sure no data are lost). But the GC write-buffer synchronization will fail, because we are already in R/O mode. This patch re-orders this and makes sure we first synchronize the write-buffer, and then switch to R/O mode. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/gc.c')
-rw-r--r--fs/ubifs/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 918d1582ca05..f89a422ca395 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -774,8 +774,8 @@ out_unlock:
out:
ubifs_assert(ret < 0);
ubifs_assert(ret != -ENOSPC && ret != -EAGAIN);
- ubifs_ro_mode(c, ret);
ubifs_wbuf_sync_nolock(wbuf);
+ ubifs_ro_mode(c, ret);
mutex_unlock(&wbuf->io_mutex);
ubifs_return_leb(c, lp.lnum);
return ret;