aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/gc.c')
-rw-r--r--fs/ubifs/gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 396f24a30af9..d927196d730b 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -616,13 +616,14 @@ int ubifs_garbage_collect(struct ubifs_info *c, int anyway)
616 struct ubifs_wbuf *wbuf = &c->jheads[GCHD].wbuf; 616 struct ubifs_wbuf *wbuf = &c->jheads[GCHD].wbuf;
617 617
618 ubifs_assert_cmt_locked(c); 618 ubifs_assert_cmt_locked(c);
619 ubifs_assert(!c->ro_media);
619 620
620 if (ubifs_gc_should_commit(c)) 621 if (ubifs_gc_should_commit(c))
621 return -EAGAIN; 622 return -EAGAIN;
622 623
623 mutex_lock_nested(&wbuf->io_mutex, wbuf->jhead); 624 mutex_lock_nested(&wbuf->io_mutex, wbuf->jhead);
624 625
625 if (c->ro_media) { 626 if (c->ro_error) {
626 ret = -EROFS; 627 ret = -EROFS;
627 goto out_unlock; 628 goto out_unlock;
628 } 629 }