]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ext4: correct the error handle in ext4_fallocate()
authorZhang Yi <yi.zhang@huawei.com>
Thu, 24 Jul 2025 02:57:17 +0000 (22:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:48:46 +0000 (09:48 +0100)
[ Upstream commit 129245cfbd6d79c6d603f357f428010ccc0f0ee7 ]

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 <libaokun1@huawei.com>
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Link: https://patch.msgid.link/20250319023557.2785018-1-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c

index 51b9533416e0468cd2c6c81d14f606373be6b218..2f9c3cd4f26ccb538ddf71621b182fe31da46216 100644 (file)
@@ -4745,7 +4745,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);