Skip to content

Commit

Permalink
udf: fix udf_setsize() for file data in ICB
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Abbott authored and Jan Kara committed Aug 14, 2012
1 parent ddf343f commit bb2b6d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/udf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,14 +1124,17 @@ int udf_setsize(struct inode *inode, loff_t newsize)
if (err)
return err;
down_write(&iinfo->i_data_sem);
} else
} else {
iinfo->i_lenAlloc = newsize;
goto set_size;
}
}
err = udf_extend_file(inode, newsize);
if (err) {
up_write(&iinfo->i_data_sem);
return err;
}
set_size:
truncate_setsize(inode, newsize);
up_write(&iinfo->i_data_sem);
} else {
Expand Down

0 comments on commit bb2b6d1

Please sign in to comment.