diff options
Diffstat (limited to 'fs/ubifs/file.c')
-rw-r--r-- | fs/ubifs/file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 03ae894c45de..d77db7e36484 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -433,8 +433,9 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping, | |||
433 | struct page *page; | 433 | struct page *page; |
434 | 434 | ||
435 | ubifs_assert(ubifs_inode(inode)->ui_size == inode->i_size); | 435 | ubifs_assert(ubifs_inode(inode)->ui_size == inode->i_size); |
436 | ubifs_assert(!c->ro_media && !c->ro_mount); | ||
436 | 437 | ||
437 | if (unlikely(c->ro_media)) | 438 | if (unlikely(c->ro_error)) |
438 | return -EROFS; | 439 | return -EROFS; |
439 | 440 | ||
440 | /* Try out the fast-path part first */ | 441 | /* Try out the fast-path part first */ |
@@ -1439,9 +1440,9 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vm | |||
1439 | 1440 | ||
1440 | dbg_gen("ino %lu, pg %lu, i_size %lld", inode->i_ino, page->index, | 1441 | dbg_gen("ino %lu, pg %lu, i_size %lld", inode->i_ino, page->index, |
1441 | i_size_read(inode)); | 1442 | i_size_read(inode)); |
1442 | ubifs_assert(!(inode->i_sb->s_flags & MS_RDONLY)); | 1443 | ubifs_assert(!c->ro_media && !c->ro_mount); |
1443 | 1444 | ||
1444 | if (unlikely(c->ro_media)) | 1445 | if (unlikely(c->ro_error)) |
1445 | return VM_FAULT_SIGBUS; /* -EROFS */ | 1446 | return VM_FAULT_SIGBUS; /* -EROFS */ |
1446 | 1447 | ||
1447 | /* | 1448 | /* |