From: Zhang Yi Date: Wed, 19 Mar 2025 02:35:57 +0000 (+0800) Subject: ext4: correct the error handle in ext4_fallocate() X-Git-Tag: v6.15-rc1~145^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=129245cfbd6d79c6d603f357f428010ccc0f0ee7;p=thirdparty%2Fkernel%2Fstable.git ext4: correct the error handle in ext4_fallocate() The error out label of file_modified() should be out_inode_lock in ext4_fallocate(). Fixes: 2890e5e0f49e ("ext4: move out common parts into ext4_fallocate()") Reported-by: Baokun Li Signed-off-by: Zhang Yi Reviewed-by: Baokun Li Link: https://patch.msgid.link/20250319023557.2785018-1-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 1639f75b54dff..c616a16a9f36d 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4744,7 +4744,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) ret = file_modified(file); if (ret) - return ret; + goto out_inode_lock; if ((mode & FALLOC_FL_MODE_MASK) == FALLOC_FL_ALLOCATE_RANGE) { ret = ext4_do_fallocate(file, offset, len, mode);