NFS: idmap: handle zero return from nfs_idmap_get_key()
Subsystems (2)
PATCH v2 1/1 NFS: idmap: handle zero return from nfs_idmap_get_key()
From: Mohammad Shahid <[email protected]>
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 <[email protected]>
--- fs/nfs/nfs4idmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4idmap.c +1 -1
@@ -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; }
Signature · 1 line
2.43.0