mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mdshahid03@gmail.com
To: mdshahid03@gmail.com
Cc: trondmy@kernel.org, anna@kernel.org, linux-nfs@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] NFS: idmap: handle zero return from nfs_idmap_get_key()
Date: Tue, 24 Nov 2026 18:39:12 +0530	[thread overview]
Message-ID: <179552575292.187304.16298525842648413199.b4-reply@b4> (raw)
In-Reply-To: <20261112162938.14329-1-mdshahid03@gmail.com>

Hi ,

Could you please check and give your feedback ? when time permits.

Thanks
Shahid.

On 2026-11-12 21:59 +0530, mdshahid03@gmail.com wrote:
> From: Mohammad Shahid <mdshahid03@gmail.com>
> 
> nfs_idmap_get_key() can return zero, but nfs_idmap_lookup_name()
> treats only negative values as errors.
> 
> Treat zero as an error to avoid reporting an unsuccessful lookup
> as successful.
> 
> Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>
> ---
>  fs/nfs/nfs4idmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c
> index 06b193722660..8f5f0abf804d 100644
> --- a/fs/nfs/nfs4idmap.c
> +++ b/fs/nfs/nfs4idmap.c
> @@ -353,7 +353,7 @@ static ssize_t nfs_idmap_lookup_name(__u32 id, const char *type, char *buf,
>  
>  	id_len = nfs_map_numeric_to_string(id, id_str, sizeof(id_str));
>  	ret = nfs_idmap_get_key(id_str, id_len, type, buf, buflen, idmap);
> -	if (ret < 0)
> +	if (ret <= 0)
>  		return -EINVAL;
>  	return ret;
>  }
> -- 
> 2.43.0
> 
> 
> 



      reply	other threads:[~2026-11-24 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 16:29 mdshahid03
2026-11-24 13:09 ` mdshahid03 [this message]

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=179552575292.187304.16298525842648413199.b4-reply@b4 \
    --to=mdshahid03@gmail.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /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®