Re: [PATCH v2 3/3] smb/client: Use d_alloc_trylock() in cifs_prime_dcache()
From: Paulo Alcantara
Date: Thu Oct 22 2026 - 20:02:57 EST
NeilBrown <neilb@xxxxxxxxxxx> 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)