diff options
author | Jan Kara <jack@suse.cz> | 2022-01-18 09:57:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-08 18:15:26 +0100 |
commit | de10d14ce3aacba73c835cb979a85ef9683c193f (patch) | |
tree | 08317350b0cb8f2f749e3c8b9948934d66af85a7 | |
parent | 58f48bfcfda282d88531880212dfaec01ceac8fb (diff) | |
download | linux-stable-de10d14ce3aacba73c835cb979a85ef9683c193f.tar.gz linux-stable-de10d14ce3aacba73c835cb979a85ef9683c193f.tar.bz2 linux-stable-de10d14ce3aacba73c835cb979a85ef9683c193f.zip |
udf: Restore i_lenAlloc when inode expansion fails
commit ea8569194b43f0f01f0a84c689388542c7254a1f upstream.
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: 7e49b6f2480c ("udf: Convert UDF to new truncate calling sequence")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/udf/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 50607673a6a9..147f608bfc0d 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -319,6 +319,7 @@ int udf_expand_file_adinicb(struct inode *inode) unlock_page(page); iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; inode->i_data.a_ops = &udf_adinicb_aops; + iinfo->i_lenAlloc = inode->i_size; up_write(&iinfo->i_data_sem); } put_page(page); |