]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/orangefs/dcache.c
Merge tag 'kbuild-v5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[mirror_ubuntu-jammy-kernel.git] / fs / orangefs / dcache.c
index ae782df5c063e460918b149136dd396ad49d51b1..fe484cf93e5cd50e749091e2c46cb22f63f3c346 100644 (file)
@@ -33,7 +33,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
        new_op->upcall.req.lookup.parent_refn = parent->refn;
        strncpy(new_op->upcall.req.lookup.d_name,
                dentry->d_name.name,
-               ORANGEFS_NAME_MAX);
+               ORANGEFS_NAME_MAX - 1);
 
        gossip_debug(GOSSIP_DCACHE_DEBUG,
                     "%s:%s:%d interrupt flag [%d]\n",
@@ -118,8 +118,12 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
                return 0;
 
        /* We do not need to continue with negative dentries. */
-       if (!dentry->d_inode)
-               goto out;
+       if (!dentry->d_inode) {
+               gossip_debug(GOSSIP_DCACHE_DEBUG,
+                   "%s: negative dentry or positive dentry and inode valid.\n",
+                   __func__);
+               return 1;
+       }
 
        /* Now we must perform a getattr to validate the inode contents. */
 
@@ -129,14 +133,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
                    __FILE__, __func__, __LINE__);
                return 0;
        }
-       if (ret == 0)
-               return 0;
-
-out:
-       gossip_debug(GOSSIP_DCACHE_DEBUG,
-           "%s: negative dentry or positive dentry and inode valid.\n",
-           __func__);
-       return 1;
+       return !ret;
 }
 
 const struct dentry_operations orangefs_dentry_operations = {