]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ubifs/gc.c
UBIFS: introduce new flag for RO due to errors
[net-next-2.6.git] / fs / ubifs / gc.c
index 396f24a30af98de54e183076c3a4a84ad61f407b..d927196d730b6a4a1e6f3c746931ef5159f794f0 100644 (file)
@@ -616,13 +616,14 @@ int ubifs_garbage_collect(struct ubifs_info *c, int anyway)
        struct ubifs_wbuf *wbuf = &c->jheads[GCHD].wbuf;
 
        ubifs_assert_cmt_locked(c);
+       ubifs_assert(!c->ro_media);
 
        if (ubifs_gc_should_commit(c))
                return -EAGAIN;
 
        mutex_lock_nested(&wbuf->io_mutex, wbuf->jhead);
 
-       if (c->ro_media) {
+       if (c->ro_error) {
                ret = -EROFS;
                goto out_unlock;
        }