Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

udf: fix udf_setsize() for file data in ICB

If the new size is larger than the old size and the old file data was
stored in the ICB (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) and the
new size still fits in the ICB, skip the call to udf_extend_file() as it
does not handle this i_alloc_type value (it calls BUG()).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Ian Abbott and committed by
Jan Kara
bb2b6d19 ddf343f6

+4 -1
+4 -1
fs/udf/inode.c
··· 1124 1124 if (err) 1125 1125 return err; 1126 1126 down_write(&iinfo->i_data_sem); 1127 - } else 1127 + } else { 1128 1128 iinfo->i_lenAlloc = newsize; 1129 + goto set_size; 1130 + } 1129 1131 } 1130 1132 err = udf_extend_file(inode, newsize); 1131 1133 if (err) { 1132 1134 up_write(&iinfo->i_data_sem); 1133 1135 return err; 1134 1136 } 1137 + set_size: 1135 1138 truncate_setsize(inode, newsize); 1136 1139 up_write(&iinfo->i_data_sem); 1137 1140 } else {