aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ubifs/recovery.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index d6c8ce3c722e..3f41a0ce192b 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -1490,18 +1490,22 @@ int ubifs_recover_size(struct ubifs_info *c)
1490 if (c->ro_mount) { 1490 if (c->ro_mount) {
1491 /* Fix the inode size and pin it in memory */ 1491 /* Fix the inode size and pin it in memory */
1492 struct inode *inode; 1492 struct inode *inode;
1493 struct ubifs_inode *ui;
1493 1494
1494 ubifs_assert(!e->inode); 1495 ubifs_assert(!e->inode);
1495 1496
1496 inode = ubifs_iget(c->vfs_sb, e->inum); 1497 inode = ubifs_iget(c->vfs_sb, e->inum);
1497 if (IS_ERR(inode)) 1498 if (IS_ERR(inode))
1498 return PTR_ERR(inode); 1499 return PTR_ERR(inode);
1500
1501 ui = ubifs_inode(inode);
1499 if (inode->i_size < e->d_size) { 1502 if (inode->i_size < e->d_size) {
1500 dbg_rcvry("ino %lu size %lld -> %lld", 1503 dbg_rcvry("ino %lu size %lld -> %lld",
1501 (unsigned long)e->inum, 1504 (unsigned long)e->inum,
1502 inode->i_size, e->d_size); 1505 inode->i_size, e->d_size);
1503 inode->i_size = e->d_size; 1506 inode->i_size = e->d_size;
1504 ubifs_inode(inode)->ui_size = e->d_size; 1507 ui->ui_size = e->d_size;
1508 ui->synced_i_size = e->d_size;
1505 e->inode = inode; 1509 e->inode = inode;
1506 this = rb_next(this); 1510 this = rb_next(this);
1507 continue; 1511 continue;