aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/recovery.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 596dede32611..d6c8ce3c722e 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -1436,7 +1436,7 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e)
1436 err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); 1436 err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN);
1437 if (err) 1437 if (err)
1438 goto out; 1438 goto out;
1439 dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ", 1439 dbg_rcvry("inode %lu at %d:%d size %lld -> %lld",
1440 (unsigned long)e->inum, lnum, offs, i_size, e->d_size); 1440 (unsigned long)e->inum, lnum, offs, i_size, e->d_size);
1441 return 0; 1441 return 0;
1442 1442
@@ -1485,11 +1485,14 @@ int ubifs_recover_size(struct ubifs_info *c)
1485 e->i_size = le64_to_cpu(ino->size); 1485 e->i_size = le64_to_cpu(ino->size);
1486 } 1486 }
1487 } 1487 }
1488
1488 if (e->exists && e->i_size < e->d_size) { 1489 if (e->exists && e->i_size < e->d_size) {
1489 if (!e->inode && c->ro_mount) { 1490 if (c->ro_mount) {
1490 /* Fix the inode size and pin it in memory */ 1491 /* Fix the inode size and pin it in memory */
1491 struct inode *inode; 1492 struct inode *inode;
1492 1493
1494 ubifs_assert(!e->inode);
1495
1493 inode = ubifs_iget(c->vfs_sb, e->inum); 1496 inode = ubifs_iget(c->vfs_sb, e->inum);
1494 if (IS_ERR(inode)) 1497 if (IS_ERR(inode))
1495 return PTR_ERR(inode); 1498 return PTR_ERR(inode);
@@ -1513,9 +1516,11 @@ int ubifs_recover_size(struct ubifs_info *c)
1513 iput(e->inode); 1516 iput(e->inode);
1514 } 1517 }
1515 } 1518 }
1519
1516 this = rb_next(this); 1520 this = rb_next(this);
1517 rb_erase(&e->rb, &c->size_tree); 1521 rb_erase(&e->rb, &c->size_tree);
1518 kfree(e); 1522 kfree(e);
1519 } 1523 }
1524
1520 return 0; 1525 return 0;
1521} 1526}