xfs
[Top] [All Lists]

Re: [PATCH] don't reallocate sxp variable passed into xfs_swapext

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] don't reallocate sxp variable passed into xfs_swapext
From: Felix Blyakher <felixb@xxxxxxx>
Date: Sun, 25 Jan 2009 21:14:50 -0600
Cc: xfs-oss <xfs@xxxxxxxxxxx>, "Rafael J. Wysocki" <rjw@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, pm@xxxxxxxxxx
In-reply-to: <497D258C.1000908@xxxxxxxxxxx>
References: <497D258C.1000908@xxxxxxxxxxx>

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@xxxxxxxxxxx
Reported-by: Paul Martin <pm@xxxxxxxxxx>
Tested-by: Paul Martin <pm@xxxxxxxxxx>

Reviewed-by Felix Blyakher <felixb@xxxxxxx>

---


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@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>