linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org
Cc: v9fs@lists.linux.dev, miklos@szeredi.hu, agruenba@redhat.com,
	linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org
Subject: Re: [PATCH 5/9] simplify vboxsf_dir_atomic_open()
Date: Thu, 18 Sep 2025 09:34:39 +0200	[thread overview]
Message-ID: <eb729729-c7cf-4a15-ab97-27ec21c0891a@kernel.org> (raw)
In-Reply-To: <20250917232736.2556586-5-viro@zeniv.linux.org.uk>

Hi,

On 18-Sep-25 1:27 AM, Al Viro wrote:
> similar to 9p et.al.
> 
> Reviewed-by: NeilBrown <neil@brown.name>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hansg@kernel.org>

Regards,

Hans



> ---
>  fs/vboxsf/dir.c | 25 +++++++++----------------
>  1 file changed, 9 insertions(+), 16 deletions(-)
> 
> diff --git a/fs/vboxsf/dir.c b/fs/vboxsf/dir.c
> index 770e29ec3557..42bedc4ec7af 100644
> --- a/fs/vboxsf/dir.c
> +++ b/fs/vboxsf/dir.c
> @@ -315,46 +315,39 @@ static int vboxsf_dir_atomic_open(struct inode *parent, struct dentry *dentry,
>  {
>  	struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
>  	struct vboxsf_handle *sf_handle;
> -	struct dentry *res = NULL;
>  	u64 handle;
>  	int err;
>  
>  	if (d_in_lookup(dentry)) {
> -		res = vboxsf_dir_lookup(parent, dentry, 0);
> -		if (IS_ERR(res))
> -			return PTR_ERR(res);
> -
> -		if (res)
> -			dentry = res;
> +		struct dentry *res = vboxsf_dir_lookup(parent, 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);
>  
>  	err = vboxsf_dir_create(parent, dentry, mode, false, flags & O_EXCL, &handle);
>  	if (err)
> -		goto out;
> +		return err;
>  
>  	sf_handle = vboxsf_create_sf_handle(d_inode(dentry), handle, SHFL_CF_ACCESS_READWRITE);
>  	if (IS_ERR(sf_handle)) {
>  		vboxsf_close(sbi->root, handle);
> -		err = PTR_ERR(sf_handle);
> -		goto out;
> +		return PTR_ERR(sf_handle);
>  	}
>  
>  	err = finish_open(file, dentry, generic_file_open);
>  	if (err) {
>  		/* This also closes the handle passed to vboxsf_create_sf_handle() */
>  		vboxsf_release_sf_handle(d_inode(dentry), sf_handle);
> -		goto out;
> +		return err;
>  	}
>  
>  	file->private_data = sf_handle;
>  	file->f_mode |= FMODE_CREATED;
> -out:
> -	dput(res);
> -	return err;
> +	return 0;
>  }
>  
>  static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)


  reply	other threads:[~2025-09-18  7:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 23:24 [PATCHES] finish_no_open() calling conventions change Al Viro
2025-09-17 23:27 ` [PATCH 1/9] allow finish_no_open(file, ERR_PTR(-E...)) Al Viro
2025-09-17 23:27   ` [PATCH 2/9] 9p: simplify v9fs_vfs_atomic_open() Al Viro
2025-09-17 23:27   ` [PATCH 3/9] 9p: simplify v9fs_vfs_atomic_open_dotl() Al Viro
2025-09-17 23:27   ` [PATCH 4/9] simplify cifs_atomic_open() Al Viro
2025-09-17 23:27   ` [PATCH 5/9] simplify vboxsf_dir_atomic_open() Al Viro
2025-09-18  7:34     ` Hans de Goede [this message]
2025-09-17 23:27   ` [PATCH 6/9] simplify nfs_atomic_open_v23() Al Viro
2025-09-17 23:27   ` [PATCH 7/9] simplify fuse_atomic_open() Al Viro
2025-09-19  9:16     ` Miklos Szeredi
2025-09-17 23:27   ` [PATCH 8/9] simplify gfs2_atomic_open() Al Viro
2025-09-17 23:27   ` [PATCH 9/9] slightly simplify nfs_atomic_open() Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2025-09-12 18:55 ->atomic_open() fun (was Re: [RFC] a possible way of reducing the PITA of ->d_name audits) Al Viro
2025-09-12 18:59 ` [PATCH 1/9] allow finish_no_open(file, ERR_PTR(-E...)) Al Viro
2025-09-12 18:59   ` [PATCH 5/9] simplify vboxsf_dir_atomic_open() Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb729729-c7cf-4a15-ab97-27ec21c0891a@kernel.org \
    --to=hansg@kernel.org \
    --cc=agruenba@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=v9fs@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).