Skip to contentSkip to conversation

fix up XFS_ERROR() usage in xfs_lrw.c

PATCH New Eric Sandeen 1 participant 1 message Aug 28, 2007 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix up XFS_ERROR() usage in xfs_lrw.c

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?)

fs/xfs/linux-2.6/xfs_lrw.c +2 -2
Index: 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)) {