From: Oleg Drokin Date: Tue, 21 Apr 2020 22:28:33 +0000 (-0400) Subject: LU-13470 ptlrpc: return proper write count from ping_store X-Git-Tag: 2.13.54~143 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=16d62976d212d94f7a3a5e61817b5ce98a4be3fd LU-13470 ptlrpc: return proper write count from ping_store 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. Change-Id: Ieb0f8bcd4f010ab4375ea6f65f6ea00248a236cb Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/38304 Tested-by: jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index 579a175..ce7d386 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -1330,7 +1330,9 @@ EXPORT_SYMBOL(ping_show); 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);