summaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-07-23 16:39:29 +0000
committerJan Kara <jack@suse.cz>2012-08-15 00:21:58 +0200
commitbb2b6d19ec8b593b66402e2895c4314955b19833 (patch)
treee3d241b0965f4e292c101a6b8b212b8c2fa57838 /fs/udf/inode.c
parentddf343f635fe4440cad528e12f96f28bd50aa099 (diff)
downloadlinux-bb2b6d19ec8b593b66402e2895c4314955b19833.tar.gz
linux-bb2b6d19ec8b593b66402e2895c4314955b19833.tar.bz2
linux-bb2b6d19ec8b593b66402e2895c4314955b19833.zip
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>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index fafaad795cd6..aa233469b3c1 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -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 {