]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ext4: correct the error path of ext4_write_inline_data_end()
authorZhang Yi <yi.zhang@huawei.com>
Fri, 16 Jul 2021 12:20:22 +0000 (20:20 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 5 Sep 2021 03:38:18 +0000 (23:38 -0400)
commit55ce2f649b9e88111270333a8127e23f4f8f42d7
tree33af2ceb5eb9b03f539c11d3828930b479ef6e35
parent4df031ff5876d94b48dd9ee486ba5522382a06b2
ext4: correct the error path of ext4_write_inline_data_end()

Current error path of ext4_write_inline_data_end() is not correct.

Firstly, it should pass out the error value if ext4_get_inode_loc()
return fail, or else it could trigger infinite loop if we inject error
here. And then it's better to add inode to orphan list if it return fail
in ext4_journal_stop(), otherwise we could not restore inline xattr
entry after power failure. Finally, we need to reset the 'ret' value if
ext4_write_inline_data_end() return success in ext4_write_end() and
ext4_journalled_write_end(), otherwise we could not get the error return
value of ext4_journal_stop().

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20210716122024.1105856-3-yi.zhang@huawei.com
fs/ext4/inline.c
fs/ext4/inode.c