Skip to content

Commit ea85691

Browse files
committed
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 <[email protected]> CC: [email protected] Fixes: 7e49b6f ("udf: Convert UDF to new truncate calling sequence") Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 7fc3b7c commit ea85691

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/udf/inode.c

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

0 commit comments

Comments
 (0)