diff options
Diffstat (limited to 'fs/ubifs/recovery.c')
-rw-r--r-- | fs/ubifs/recovery.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index daae9e1f5382..77e9b874b6c2 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -292,7 +292,7 @@ int ubifs_recover_master_node(struct ubifs_info *c) | |||
292 | 292 | ||
293 | memcpy(c->mst_node, mst, UBIFS_MST_NODE_SZ); | 293 | memcpy(c->mst_node, mst, UBIFS_MST_NODE_SZ); |
294 | 294 | ||
295 | if ((c->vfs_sb->s_flags & MS_RDONLY)) { | 295 | if (c->ro_mount) { |
296 | /* Read-only mode. Keep a copy for switching to rw mode */ | 296 | /* Read-only mode. Keep a copy for switching to rw mode */ |
297 | c->rcvrd_mst_node = kmalloc(sz, GFP_KERNEL); | 297 | c->rcvrd_mst_node = kmalloc(sz, GFP_KERNEL); |
298 | if (!c->rcvrd_mst_node) { | 298 | if (!c->rcvrd_mst_node) { |
@@ -469,7 +469,7 @@ static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, | |||
469 | endpt = snod->offs + snod->len; | 469 | endpt = snod->offs + snod->len; |
470 | } | 470 | } |
471 | 471 | ||
472 | if ((c->vfs_sb->s_flags & MS_RDONLY) && !c->remounting_rw) { | 472 | if (c->ro_mount && !c->remounting_rw) { |
473 | /* Add to recovery list */ | 473 | /* Add to recovery list */ |
474 | struct ubifs_unclean_leb *ucleb; | 474 | struct ubifs_unclean_leb *ucleb; |
475 | 475 | ||
@@ -772,7 +772,8 @@ out_free: | |||
772 | * @sbuf: LEB-sized buffer to use | 772 | * @sbuf: LEB-sized buffer to use |
773 | * | 773 | * |
774 | * This function does a scan of a LEB, but caters for errors that might have | 774 | * This function does a scan of a LEB, but caters for errors that might have |
775 | * been caused by the unclean unmount from which we are attempting to recover. | 775 | * been caused by unclean reboots from which we are attempting to recover |
776 | * (assume that only the last log LEB can be corrupted by an unclean reboot). | ||
776 | * | 777 | * |
777 | * This function returns %0 on success and a negative error code on failure. | 778 | * This function returns %0 on success and a negative error code on failure. |
778 | */ | 779 | */ |
@@ -883,7 +884,7 @@ int ubifs_recover_inl_heads(const struct ubifs_info *c, void *sbuf) | |||
883 | { | 884 | { |
884 | int err; | 885 | int err; |
885 | 886 | ||
886 | ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY) || c->remounting_rw); | 887 | ubifs_assert(!c->ro_mount || c->remounting_rw); |
887 | 888 | ||
888 | dbg_rcvry("checking index head at %d:%d", c->ihead_lnum, c->ihead_offs); | 889 | dbg_rcvry("checking index head at %d:%d", c->ihead_lnum, c->ihead_offs); |
889 | err = recover_head(c, c->ihead_lnum, c->ihead_offs, sbuf); | 890 | err = recover_head(c, c->ihead_lnum, c->ihead_offs, sbuf); |
@@ -1461,7 +1462,7 @@ int ubifs_recover_size(struct ubifs_info *c) | |||
1461 | } | 1462 | } |
1462 | } | 1463 | } |
1463 | if (e->exists && e->i_size < e->d_size) { | 1464 | if (e->exists && e->i_size < e->d_size) { |
1464 | if (!e->inode && (c->vfs_sb->s_flags & MS_RDONLY)) { | 1465 | if (!e->inode && c->ro_mount) { |
1465 | /* Fix the inode size and pin it in memory */ | 1466 | /* Fix the inode size and pin it in memory */ |
1466 | struct inode *inode; | 1467 | struct inode *inode; |
1467 | 1468 | ||