don't reallocate sxp variable passed into xfs_swapext
PATCH 1/1 don't reallocate sxp variable passed into xfs_swapext
fixes kernel.org bugzilla 12538, xfs_fsr fails on 2.6.29-rc kernels
Regression caused by 743bb4650da9e2595d6cedd01c680b5b9398c74a
This was an embarrasing mistake, reallocating the sxp pointer passed in from the main ioctl switch.
---
fs/xfs/xfs_dfrag.c +1 -9
@@ -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; }
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Eric Sandeen
fixes kernel.org bugzilla 12538,
xfs_fsrfails on 2.6.29-rc kernelsRegression caused by
743bb4650da9e2595d6cedd01c680b5b9398c74aThis was an embarrasing mistake, reallocating the sxp pointer passed in from the main ioctl switch.
Signed-off-by Eric Sandeen <[email protected]Reported-by Paul Martin <[email protected]>Tested-by Paul Martin <[email protected]>
Reviewed-by Felix Blyakher <[email protected]>
Quoted 38 lines
---
Index:
linux-2.6/fs/xfs/xfs_dfrag.c
===================================================================fs/xfs/xfs_dfrag.c +1
-9@@ -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; }
Quoted 4 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Eric Sandeen
fixes kernel.org bugzilla 12538,
xfs_fsrfails on 2.6.29-rc kernelsRegression caused by
743bb4650da9e2595d6cedd01c680b5b9398c74aThis was an embarrasing mistake, reallocating the sxp pointer passed in from the main ioctl switch.
Signed-off-by Eric Sandeen <[email protected]Reported-by Paul Martin <[email protected]>Tested-by Paul Martin <[email protected]>
Yikes. Looks good to me, but any chance you could try cooking up a xfsqa test that would hit this as our existing xfs_fsr test apparently doesn't?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs