[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1382754793-8827-2-git-send-email-dwalker@fifo99.com>
Date: Fri, 25 Oct 2013 19:33:12 -0700
From: Daniel Walker <dwalker@...o99.com>
To: "J. Bruce Fields" <bfields@...ldses.org>
Cc: linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] fs: nfsd: remove calls to simple_strtoll
Signed-off-by: Daniel Walker <dwalker@...o99.com>
---
fs/nfsd/fault_inject.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c
index d620e7f..41165f0 100644
--- a/fs/nfsd/fault_inject.c
+++ b/fs/nfsd/fault_inject.c
@@ -125,20 +125,24 @@ static ssize_t fault_inject_write(struct file *file, const char __user *buf,
size_t size = min(sizeof(write_buf) - 1, len);
struct net *net = current->nsproxy->net_ns;
struct sockaddr_storage sa;
+ int ret = -EFAULT;
u64 val;
if (copy_from_user(write_buf, buf, size))
- return -EFAULT;
+ return ret;
write_buf[size] = '\0';
size = rpc_pton(net, write_buf, size, (struct sockaddr *)&sa, sizeof(sa));
if (size > 0)
nfsd_inject_set_client(file_inode(file)->i_private, &sa, size);
else {
- val = simple_strtoll(write_buf, NULL, 0);
- nfsd_inject_set(file_inode(file)->i_private, val);
+ ret = kstrtoll(write_buf, 0, &val);
+ if (ret == 0) {
+ nfsd_inject_set(file_inode(file)->i_private, val);
+ ret = len;
+ }
}
- return len; /* on success, claim we got the whole input */
+ return ret; /* on success, claim we got the whole input */
}
static const struct file_operations fops_nfsd = {
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists