Commit 8971a101 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] knfsd: fix return value for writes to some files in 'nfsd' filesystem

Most files in the 'nfsd' filesystem are transactional.  When you write, a
reply is generated that can be read back only on the same 'file'.

If the reply has zero length, the 'write' will incorrectly return a value of
'0' instead of the length that was written.  This causes 'rpc.nfsd' to give an
annoying warning.

This patch fixes the test.
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 754ce4f2
...@@ -123,7 +123,7 @@ static ssize_t nfsctl_transaction_write(struct file *file, const char __user *bu ...@@ -123,7 +123,7 @@ static ssize_t nfsctl_transaction_write(struct file *file, const char __user *bu
return PTR_ERR(data); return PTR_ERR(data);
rv = write_op[ino](file, data, size); rv = write_op[ino](file, data, size);
if (rv>0) { if (rv >= 0) {
simple_transaction_set(file, rv); simple_transaction_set(file, rv);
rv = size; rv = size;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment