]> Git Repo - J-linux.git/commitdiff
fs: orangefs: fix error return code of orangefs_revalidate_lookup()
authorJia-Ju Bai <[email protected]>
Tue, 9 Mar 2021 08:00:20 +0000 (00:00 -0800)
committerMike Marshall <[email protected]>
Mon, 11 Oct 2021 18:25:34 +0000 (14:25 -0400)
When op_alloc() returns NULL to new_op, no error return code of
orangefs_revalidate_lookup() is assigned.
To fix this bug, ret is assigned with -ENOMEM in this case.

Fixes: 8bb8aefd5afb ("OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.")
Reported-by: TOTE Robot <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
Signed-off-by: Mike Marshall <[email protected]>
fs/orangefs/dcache.c

index fe484cf93e5cd50e749091e2c46cb22f63f3c346..8bbe9486e3a6228c40c46971d23c305127e2007b 100644 (file)
@@ -26,8 +26,10 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
        gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: attempting lookup.\n", __func__);
 
        new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP);
-       if (!new_op)
+       if (!new_op) {
+               ret = -ENOMEM;
                goto out_put_parent;
+       }
 
        new_op->upcall.req.lookup.sym_follow = ORANGEFS_LOOKUP_LINK_NO_FOLLOW;
        new_op->upcall.req.lookup.parent_refn = parent->refn;
This page took 0.052024 seconds and 4 git commands to generate.