Fix up a couple of XFS_ERROR callers who send a negative errno
rather than negating the macro itself, at odds with all other
callers (if xfs_etrap contained EINVAL this would not be caught)
(hm, should xfs_read be using generic_segment_checks?)
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c
@@ -210,7 +210,7 @@ xfs_read(
*/
size += iv->iov_len;
if (unlikely((ssize_t)(size|iv->iov_len) < 0))
- return XFS_ERROR(-EINVAL);
+ return -XFS_ERROR(EINVAL);
}
/* END copy & waste from filemap.c */
@@ -740,7 +740,7 @@ start:
if ((pos & target->bt_smask) || (count & target->bt_smask)) {
xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock);
- return XFS_ERROR(-EINVAL);
+ return -XFS_ERROR(EINVAL);
}
if (!need_i_mutex && (VN_CACHED(vp) || pos > xip->i_size)) {
|