f2fs: set errno when f2fs_iget failed in recover_dentry
authorChao Yu <chao2.yu@samsung.com>
Mon, 28 Apr 2014 09:58:34 +0000 (17:58 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 7 May 2014 01:21:57 +0000 (10:21 +0900)
We should set the error number correctly when we fail in recover_dentry(), so
the recover flow could stop for the reason as error number shows instead of
continuing.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/recovery.c

index be1e3e881725f3612ce8a003b8329ca43d06beaf..e950a2f50ac1173537ba5492626bd5f7940fadd1 100644 (file)
@@ -75,7 +75,8 @@ retry:
                einode = f2fs_iget(inode->i_sb, le32_to_cpu(de->ino));
                if (IS_ERR(einode)) {
                        WARN_ON(1);
-                       if (PTR_ERR(einode) == -ENOENT)
+                       err = PTR_ERR(einode);
+                       if (err == -ENOENT)
                                err = -EEXIST;
                        goto out_unmap_put;
                }