* [PATCH] don't reallocate sxp variable passed into xfs_swapext
@ 2009-01-26 2:53 Eric Sandeen
2009-01-26 3:14 ` Felix Blyakher
2009-01-26 7:46 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2009-01-26 2:53 UTC (permalink / raw)
To: xfs-oss; +Cc: Rafael J. Wysocki, Andrew Morton, pm
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.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net
Reported-by: Paul Martin <pm@debian.org>
Tested-by: Paul Martin <pm@debian.org>
---
Index: linux-2.6/fs/xfs/xfs_dfrag.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_dfrag.c
+++ linux-2.6/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;
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] don't reallocate sxp variable passed into xfs_swapext
2009-01-26 2:53 [PATCH] don't reallocate sxp variable passed into xfs_swapext Eric Sandeen
@ 2009-01-26 3:14 ` Felix Blyakher
2009-01-26 7:46 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Felix Blyakher @ 2009-01-26 3:14 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Rafael J. Wysocki, Andrew Morton, pm, xfs-oss
On Jan 25, 2009, at 8:53 PM, Eric Sandeen wrote:
> 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.
>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net
> Reported-by: Paul Martin <pm@debian.org>
> Tested-by: Paul Martin <pm@debian.org>
Reviewed-by Felix Blyakher <felixb@sgi.com>
> ---
>
>
> Index: linux-2.6/fs/xfs/xfs_dfrag.c
> ===================================================================
> --- linux-2.6.orig/fs/xfs/xfs_dfrag.c
> +++ linux-2.6/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;
> }
>
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] don't reallocate sxp variable passed into xfs_swapext
2009-01-26 2:53 [PATCH] don't reallocate sxp variable passed into xfs_swapext Eric Sandeen
2009-01-26 3:14 ` Felix Blyakher
@ 2009-01-26 7:46 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2009-01-26 7:46 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Rafael J. Wysocki, Andrew Morton, pm, xfs-oss
On Sun, Jan 25, 2009 at 08:53:00PM -0600, Eric Sandeen wrote:
> 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.
>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net
> Reported-by: Paul Martin <pm@debian.org>
> Tested-by: Paul Martin <pm@debian.org>
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?
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-26 7:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 2:53 [PATCH] don't reallocate sxp variable passed into xfs_swapext Eric Sandeen
2009-01-26 3:14 ` Felix Blyakher
2009-01-26 7:46 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox