staging: lustre: honor error code from ll_iget().
authorNeilBrown <neilb@suse.com>
Mon, 12 Feb 2018 21:09:25 +0000 (08:09 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 14:13:32 +0000 (15:13 +0100)
Commit 020ecc6f3229 ("staging: lustre: llite: Remove IS_ERR tests")
changed ll_prep_inode to assume any error from ll_iget() meant
-ENOMEM because at that time it only returned NULL for errors.
Commit c3397e7e677b ("staging: lustre: llite: add error handler in
inode prepare phase") changed ll_iget() to once again return
meaningful codes, but nobody told ll_prep_inode().

So change ll_prep_inode() back to using PTR_ERR(*inode).

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c

index 6735a6f..020f0fa 100644 (file)
@@ -2143,7 +2143,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
                                md.posix_acl = NULL;
                        }
 #endif
-                       rc = -ENOMEM;
+                       rc = PTR_ERR(*inode);
                        CERROR("new_inode -fatal: rc %d\n", rc);
                        goto out;
                }