aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r--fs/udf/file.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 7376032c89ce..04bb5bf07630 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -236,7 +236,17 @@ static int udf_setattr(struct dentry *dentry, struct iattr *attr)
236 error = inode_change_ok(inode, attr); 236 error = inode_change_ok(inode, attr);
237 if (error) 237 if (error)
238 return error; 238 return error;
239 return inode_setattr(inode, attr); 239
240 if ((attr->ia_valid & ATTR_SIZE) &&
241 attr->ia_size != i_size_read(inode)) {
242 error = vmtruncate(inode, attr->ia_size);
243 if (error)
244 return error;
245 }
246
247 setattr_copy(inode, attr);
248 mark_inode_dirty(inode);
249 return 0;
240} 250}
241 251
242const struct inode_operations udf_file_inode_operations = { 252const struct inode_operations udf_file_inode_operations = {