aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4idmap.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-05 11:05:54 +0100
committerMark Brown <broonie@kernel.org>2018-07-05 11:05:54 +0100
commit0ea97d66df2a8b85698823b4d55d798a7870d7b5 (patch)
treee4f36af1342ebcbcb5878e66b1e72661b6f2ca1d /fs/nfs/nfs4idmap.c
parenteed41b9f413f40183095d27ffc94fb942fe18bb6 (diff)
parent6183a1afdd2fb1c994e95af9d6db45f157241a04 (diff)
Merge branch 'linux-linaro-lsk-v4.14' into linux-linaro-lsk-v4.14-rtlsk-v4.14-18.07-rt
Diffstat (limited to 'fs/nfs/nfs4idmap.c')
-rw-r--r--fs/nfs/nfs4idmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c
index 22dc30a679a0..b6f9d84ba19b 100644
--- a/fs/nfs/nfs4idmap.c
+++ b/fs/nfs/nfs4idmap.c
@@ -343,7 +343,7 @@ static ssize_t nfs_idmap_lookup_name(__u32 id, const char *type, char *buf,
int id_len;
ssize_t ret;
- id_len = snprintf(id_str, sizeof(id_str), "%u", id);
+ 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)
return -EINVAL;
@@ -627,7 +627,8 @@ static int nfs_idmap_read_and_verify_message(struct idmap_msg *im,
if (strcmp(upcall->im_name, im->im_name) != 0)
break;
/* Note: here we store the NUL terminator too */
- len = sprintf(id_str, "%d", im->im_id) + 1;
+ len = 1 + nfs_map_numeric_to_string(im->im_id, id_str,
+ sizeof(id_str));
ret = nfs_idmap_instantiate(key, authkey, id_str, len);
break;
case IDMAP_CONV_IDTONAME: