Skip to contentSkip to conversation

f2fs: Recover when journal contains deleted files

PATCH Superseded Chris Fries 1 participant 1 message May 2, 2013 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 f2fs: Recover when journal contains deleted files

From: Chris Fries <[email protected]>

When recovering a journal file with fsync data for files that have been deleted, don't bail out on recovery.

---
 fs/f2fs/recovery.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
fs/f2fs/recovery.c +7 -2
index f16d12d..c3a7ab0 100644
@@ -53,7 +53,7 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
 
     dir = f2fs_iget(inode->i_sb, le32_to_cpu(raw_inode->i_pino));
     if (IS_ERR(dir)) {
-        err = -EINVAL;
+        err = PTR_ERR(dir);
         goto out;
     }
 
@@ -157,7 +157,12 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
         if (IS_INODE(page)) {
             err = recover_inode(entry->inode, page);
             if (err)
-                goto unlock_out;
+                if (err == -ENOENT)
+                    goto next;
+                else {
+                    err = -EINVAL;
+                    goto unlock_out;
+                }
         }
 next:
         /* check next segment */
Signature · 1 line
1.8.0