[xfs-masters] [merged] xfs-dont-reallocate-sxp-variable-passed-into-xfs_swapext.patch removed from -mm tree

akpm at linux-foundation.org akpm at linux-foundation.org
Mon Feb 2 13:37:05 CST 2009


The patch titled
     xfs: don't reallocate sxp variable passed into xfs_swapext
has been removed from the -mm tree.  Its filename was
     xfs-dont-reallocate-sxp-variable-passed-into-xfs_swapext.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: xfs: don't reallocate sxp variable passed into xfs_swapext
From: Eric Sandeen <sandeen at sandeen.net>

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12538, "xfs_fsr fails
on 2.6.29-rc kernels"

Regression caused by 743bb4650da9e2595d6cedd01c680b5b9398c74a ("[XFS] Move
copy_from_user calls out of ioctl helpers into ioctl switch").

This was an embarrasing mistake, reallocating the sxp pointer passed in
from the main ioctl switch.

Signed-off-by: Eric Sandeen <sandeen at sandeen.net
Reported-by: Paul Martin <pm at debian.org>
Tested-by: Paul Martin <pm at debian.org>
Reviewed-by Felix Blyakher <felixb at sgi.com>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Cc: <xfs-masters at oss.sgi.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 fs/xfs/xfs_dfrag.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff -puN fs/xfs/xfs_dfrag.c~xfs-dont-reallocate-sxp-variable-passed-into-xfs_swapext fs/xfs/xfs_dfrag.c
--- a/fs/xfs/xfs_dfrag.c~xfs-dont-reallocate-sxp-variable-passed-into-xfs_swapext
+++ a/fs/xfs/xfs_dfrag.c
@@ -55,17 +55,11 @@ xfs_swapext(
 	struct file	*file, *target_file;
 	int		error = 0;
 
-	sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
-	if (!sxp) {
-		error = XFS_ERROR(ENOMEM);
-		goto out;
-	}
-
 	/* Pull information for the target fd */
 	file = fget((int)sxp->sx_fdtarget);
 	if (!file) {
 		error = XFS_ERROR(EINVAL);
-		goto out_free_sxp;
+		goto out;
 	}
 
 	if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) {
@@ -109,8 +103,6 @@ xfs_swapext(
 	fput(target_file);
  out_put_file:
 	fput(file);
- out_free_sxp:
-	kmem_free(sxp);
  out:
 	return error;
 }
_

Patches currently in -mm which might be from sandeen at sandeen.net are

linux-next.patch



More information about the xfs-masters mailing list