Skip to content

Commit

Permalink
don't reallocate sxp variable passed into xfs_swapext
Browse files Browse the repository at this point in the history
fixes kernel.org bugzilla 12538, xfs_fsr fails on 2.6.29-rc kernels

Regression caused by 743bb46

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>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
  • Loading branch information
Eric Sandeen authored and Felix Blyakher committed Jan 27, 2009
1 parent 5e10657 commit ac12b4e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions fs/xfs/xfs_dfrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -109,8 +103,6 @@ xfs_swapext(
fput(target_file);
out_put_file:
fput(file);
out_free_sxp:
kmem_free(sxp);
out:
return error;
}
Expand Down

0 comments on commit ac12b4e

Please sign in to comment.