[lustre-devel] [PATCH 09/45] lustre: ptlrpc: return proper write count from ping_store
James Simmons
jsimmons at infradead.org
Mon May 25 15:07:46 PDT 2020
From: Oleg Drokin <green at whamcloud.com>
If we return 0 as a measure of success, that is actually taken
by userspace as "we wrote 0 bytes, but there's no error, so
they want us to retry". So tell them we ate all their data
instead to make them happy.
Interesting that when you do shell-redirect it enters the
retry loop, but badarea_io does not.
WC-bug-id: https://jira.whamcloud.com/browse/LU-13470
Lustre-commit: 16d62976d212d ("LU-13470 ptlrpc: return proper write count from ping_store")
Signed-off-by: Oleg Drokin <green at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38304
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
fs/lustre/ptlrpc/lproc_ptlrpc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/lustre/ptlrpc/lproc_ptlrpc.c b/fs/lustre/ptlrpc/lproc_ptlrpc.c
index 5125ecd..86ec1f5 100644
--- a/fs/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/fs/lustre/ptlrpc/lproc_ptlrpc.c
@@ -1271,7 +1271,9 @@ ssize_t ping_show(struct kobject *kobj, struct attribute *attr,
ssize_t ping_store(struct kobject *kobj, struct attribute *attr,
const char *buffer, size_t count)
{
- return ping_show(kobj, attr, (char *)buffer);
+ int rc = ping_show(kobj, attr, (char *)buffer);
+
+ return (rc < 0) ? rc : count;
}
EXPORT_SYMBOL(ping_store);
--
1.8.3.1
More information about the lustre-devel
mailing list