]> git.baikalelectronics.ru Git - kernel.git/commit
udf: Restore i_lenAlloc when inode expansion fails
authorJan Kara <jack@suse.cz>
Tue, 18 Jan 2022 08:57:25 +0000 (09:57 +0100)
committerJan Kara <jack@suse.cz>
Mon, 24 Jan 2022 13:45:02 +0000 (14:45 +0100)
commite76f5da9291969a075e08822f8c6c4d820dc2180
treebdabba9ed18aab1a83dfbef27495b955d42fbac6
parente0d64281abb54318fb52ba639e750f1b96093eef
udf: Restore i_lenAlloc when inode expansion fails

When we fail to expand inode from inline format to a normal format, we
restore inode to contain the original inline formatting but we forgot to
set i_lenAlloc back. The mismatch between i_lenAlloc and i_size was then
causing further problems such as warnings and lost data down the line.

Reported-by: butt3rflyh4ck <butterflyhuangxx@gmail.com>
CC: stable@vger.kernel.org
Fixes: 9788aff34d25 ("udf: Convert UDF to new truncate calling sequence")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/inode.c