From 6d4c1a30b32a377083900f39c42bcacb633f99a1 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Tue, 16 Feb 2016 20:15:43 -0500
Subject: [PATCH] orangefs: fix do_readv_writev() handling of error halfway
 through

Error should only be returned if nothing had been read/written.
Otherwise we need to report a short read/write instead.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
---
 fs/orangefs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index cb6a164b27180..ae92795ed9658 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -350,9 +350,9 @@ static ssize_t do_readv_writev(enum ORANGEFS_io_type type, struct file *file,
 			break;
 	} /*end while */
 
+out:
 	if (total_count > 0)
 		ret = total_count;
-out:
 	if (ret > 0) {
 		if (type == ORANGEFS_IO_READ) {
 			file_accessed(file);
-- 
GitLab