xfs
[Top] [All Lists]

[PATCH] fix up XFS_ERROR() usage in xfs_lrw.c

To: xfs mailing list <xfs@xxxxxxxxxxx>
Subject: [PATCH] fix up XFS_ERROR() usage in xfs_lrw.c
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 28 Aug 2007 16:10:44 -0500
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.12 (X11/20070530)
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)) {



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] fix up XFS_ERROR() usage in xfs_lrw.c, Eric Sandeen <=