2012-01-06 21:47:18

by Djalal Harouni

[permalink] [raw]
Subject: [PATCH] ext4: release donor reference when EXT4_IOC_MOVE_EXT ioctl fails

When the EXT4_IOC_MOVE_EXT ioctl() fails on bigalloc file systems, we
should jump to the 'mext_out' label to release the donor file reference.

Signed-off-by: Djalal Harouni <[email protected]>
---
fs/ext4/ioctl.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index a567968..034e147 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -237,7 +237,8 @@ setversion_out:
EXT4_FEATURE_RO_COMPAT_BIGALLOC)) {
ext4_msg(sb, KERN_ERR,
"Online defrag not supported with bigalloc");
- return -EOPNOTSUPP;
+ err = -EOPNOTSUPP;
+ goto mext_out;
}

err = mnt_want_write(filp->f_path.mnt);
--
1.7.1


2012-09-27 02:59:30

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: release donor reference when EXT4_IOC_MOVE_EXT ioctl fails

On Fri, Jan 06, 2012 at 10:50:13PM +0100, Djalal Harouni wrote:
> When the EXT4_IOC_MOVE_EXT ioctl() fails on bigalloc file systems, we
> should jump to the 'mext_out' label to release the donor file reference.
>
> Signed-off-by: Djalal Harouni <[email protected]>

Thanks, applied!

- Ted