]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
9p: simplify v9fs_vfs_atomic_open_dotl()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Sep 2025 15:34:57 +0000 (11:34 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 17 Sep 2025 03:59:38 +0000 (23:59 -0400)
again, preexisting aliases will always be positive

Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/9p/vfs_inode_dotl.c

index 5b5fda617b805a87153ad51f23a23efc7f355454..be297e33546889d99531562431af47cb0f1b1fe6 100644 (file)
@@ -238,20 +238,16 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
        struct p9_fid *dfid = NULL, *ofid = NULL;
        struct v9fs_session_info *v9ses;
        struct posix_acl *pacl = NULL, *dacl = NULL;
-       struct dentry *res = NULL;
 
        if (d_in_lookup(dentry)) {
-               res = v9fs_vfs_lookup(dir, dentry, 0);
-               if (IS_ERR(res))
-                       return PTR_ERR(res);
-
-               if (res)
-                       dentry = res;
+               struct dentry *res = v9fs_vfs_lookup(dir, dentry, 0);
+               if (res || d_really_is_positive(dentry))
+                       return  finish_no_open(file, res);
        }
 
        /* Only creates */
-       if (!(flags & O_CREAT) || d_really_is_positive(dentry))
-               return  finish_no_open(file, res);
+       if (!(flags & O_CREAT))
+               return  finish_no_open(file, NULL);
 
        v9ses = v9fs_inode2v9ses(dir);
 
@@ -337,7 +333,6 @@ out:
        p9_fid_put(ofid);
        p9_fid_put(fid);
        v9fs_put_acl(dacl, pacl);
-       dput(res);
        return err;
 }