Browse Source

orangefs_bufmap_copy_from_iovec(): fix EFAULT handling

short copy here should mean instant EFAULT, not "move to the
next page and hope it fails there, this time with nothing
copied"

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 8 years ago
parent
commit
890559e34e
1 changed files with 1 additions and 3 deletions
  1. 1 3
      fs/orangefs/orangefs-bufmap.c

+ 1 - 3
fs/orangefs/orangefs-bufmap.c

@@ -521,13 +521,11 @@ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
 		size_t n = size;
 		if (n > PAGE_SIZE)
 			n = PAGE_SIZE;
-		n = copy_page_from_iter(page, 0, n, iter);
-		if (!n)
+		if (copy_page_from_iter(page, 0, n, iter) != n)
 			return -EFAULT;
 		size -= n;
 	}
 	return 0;
-
 }
 
 /*