mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: NeilBrown <neil@brown.name>, Namjae Jeon <linkinjeon@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] smb/client: Use d_alloc_trylock() in cifs_prime_dcache()
Date: Thu, 22 Oct 2026 21:02:31 -0300	[thread overview]
Message-ID: <8b7c86a805f36b8556e742c76eaf0a1e@manguebit.org> (raw)
In-Reply-To: <20260929024352.1433257-4-neilb@ownmail.net>

NeilBrown <neilb@ownmail.net> writes:

> @@ -77,36 +77,34 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
>  
>  	cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
>  
> -	dentry = try_lookup_noperm(name, parent);
> -	if (!dentry) {
> -		/*
> -		 * If we know that the inode will need to be revalidated
> -		 * immediately, then don't create a new dentry for it.
> -		 * We'll end up doing an on the wire call either way and
> -		 * this spares us an invalidation.
> -		 */
> -retry:
> -		if (posix) {
> -			switch (fattr->cf_mode & S_IFMT) {
> -			case S_IFLNK:
> -			case S_IFBLK:
> -			case S_IFCHR:
> -				reparse_need_reval = true;
> -				break;
> -			default:
> -				break;
> -			}
> -		} else if (fattr->cf_cifsattrs & ATTR_REPARSE_POINT) {
> +	/*
> +	 * If we know that the inode will need to be revalidated
> +	 * immediately, then don't create a new dentry for it.
> +	 * We'll end up doing an on the wire call either way and
> +	 * this spares us an invalidation.
> +	 */
> +	if (posix) {
> +		switch (fattr->cf_mode & S_IFMT) {
> +		case S_IFLNK:
> +		case S_IFBLK:
> +		case S_IFCHR:
>  			reparse_need_reval = true;
> +			break;
> +		default:
> +			break;
>  		}
> +	} else if (fattr->cf_cifsattrs & ATTR_REPARSE_POINT) {
> +		reparse_need_reval = true;
> +	}
>  
> -		if (reparse_need_reval ||
> -		    (fattr->cf_flags & CIFS_FATTR_NEED_REVAL))
> -			return;
> +retry:
> +	if (reparse_need_reval ||
> +	    (fattr->cf_flags & CIFS_FATTR_NEED_REVAL))
> +		dentry = try_lookup_noperm(name, parent);
> +	else
> +		dentry = d_alloc_trylock(parent, name);
>  
> -		dentry = d_alloc_parallel(parent, name);
> -	}
> -	if (IS_ERR(dentry))
> +	if (!dentry || IS_ERR(dentry))

nit: IS_ERR_OR_NULL(dentry)

  reply	other threads:[~2026-10-23  0:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  2:40 [PATCH v2 0/3] smb/client(cifs): prepare for VFS locking changes NeilBrown
2026-09-29  2:40 ` [PATCH v2 1/3] smb/client: don't unhash and rehash to prevent new opens NeilBrown
2026-09-29  2:40 ` [PATCH v2 2/3] smb/client: use d_alloc_trylock in cifs_silly_fullpath() NeilBrown
2026-09-29  2:40 ` [PATCH v2 3/3] smb/client: Use d_alloc_trylock() in cifs_prime_dcache() NeilBrown
2026-10-23  0:02   ` Paulo Alcantara [this message]
2026-10-23  1:32     ` NeilBrown
2026-10-21 13:43 ` [PATCH v2 0/3] smb/client(cifs): prepare for VFS locking changes Namjae Jeon
2026-10-23  0:03 ` Paulo Alcantara

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=8b7c86a805f36b8556e742c76eaf0a1e@manguebit.org \
    --to=pc@manguebit.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil@brown.name \
    --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

all inboxes | Powered by JetHome®