]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: avoid BUG_ON when creating xattrs
authorJan Kara <jack@suse.cz>
Mon, 21 Nov 2022 13:09:29 +0000 (14:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:52 +0000 (11:41 +0100)
commit312d0d7654122eb8ba8e918a0edc335f5872ef81
treef524d2edb8ecc3b5d830ba151f1de807bc1a911f
parente58c49618abf1836244f8b921a5f4ae4c5a2abc3
ext4: avoid BUG_ON when creating xattrs

commit 73fadec77c9a029666e4de8789f4ceb105901414 upstream.

Commit 984ea3e1a886 ("ext4: limit block allocations for indirect-block
files to < 2^32") added code to try to allocate xattr block with 32-bit
block number for indirect block based files on the grounds that these
files cannot use larger block numbers. It also added BUG_ON when
allocated block could not fit into 32 bits. This is however bogus
reasoning because xattr block is stored in inode->i_file_acl and
inode->i_file_acl_hi and as such even indirect block based files can
happily use full 48 bits for xattr block number. The proper handling
seems to be there basically since 64-bit block number support was added.
So remove the bogus limitation and BUG_ON.

Cc: Eric Sandeen <sandeen@redhat.com>
Fixes: 984ea3e1a886 ("ext4: limit block allocations for indirect-block files to < 2^32")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20221121130929.32031-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c