mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
udf: Restore i_lenAlloc when inode expansion fails
commitea8569194bupstream. 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:7e49b6f248("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>
This commit is contained in:
parent
f08801252d
commit
0a3cfd2589
|
|
@ -316,6 +316,7 @@ int udf_expand_file_adinicb(struct inode *inode)
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
|
iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
|
||||||
inode->i_data.a_ops = &udf_adinicb_aops;
|
inode->i_data.a_ops = &udf_adinicb_aops;
|
||||||
|
iinfo->i_lenAlloc = inode->i_size;
|
||||||
up_write(&iinfo->i_data_sem);
|
up_write(&iinfo->i_data_sem);
|
||||||
}
|
}
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user