* [PATCH v2] NFS: idmap: handle zero return from nfs_idmap_get_key()
@ 2026-11-12 16:29 mdshahid03
0 siblings, 0 replies; only message in thread
From: mdshahid03 @ 2026-11-12 16:29 UTC (permalink / raw)
To: trondmy; +Cc: anna, linux-nfs, linux-kernel, Mohammad Shahid
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-12 16:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 16:29 [PATCH v2] NFS: idmap: handle zero return from nfs_idmap_get_key() mdshahid03
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®