Skip to content

Commit 0a3cfd2

Browse files
jankaragregkh
authored andcommitted
udf: Restore i_lenAlloc when inode expansion fails
commit ea85691 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: 7e49b6f ("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>
1 parent f088012 commit 0a3cfd2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/udf/inode.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ int udf_expand_file_adinicb(struct inode *inode)
316316
unlock_page(page);
317317
iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
318318
inode->i_data.a_ops = &udf_adinicb_aops;
319+
iinfo->i_lenAlloc = inode->i_size;
319320
up_write(&iinfo->i_data_sem);
320321
}
321322
put_page(page);

0 commit comments

Comments
 (0)