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.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c
index f311d509b6a3..35ca47281faa 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -34,6 +34,7 @@
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/smp_lock.h> 35#include <linux/smp_lock.h>
36#include <linux/pagemap.h> 36#include <linux/pagemap.h>
37#include <linux/quotaops.h>
37#include <linux/buffer_head.h> 38#include <linux/buffer_head.h>
38#include <linux/aio.h> 39#include <linux/aio.h>
39 40
@@ -217,6 +218,26 @@ const struct file_operations udf_file_operations = {
217 .llseek = generic_file_llseek, 218 .llseek = generic_file_llseek,
218}; 219};
219 220
221static int udf_setattr(struct dentry *dentry, struct iattr *iattr)
222{
223 struct inode *inode = dentry->d_inode;
224 int error;
225
226 error = inode_change_ok(inode, iattr);
227 if (error)
228 return error;
229
230 if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
231 (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
232 error = vfs_dq_transfer(inode, iattr) ? -EDQUOT : 0;
233 if (error)
234 return error;
235 }
236
237 return inode_setattr(inode, iattr);
238}
239
220const struct inode_operations udf_file_inode_operations = { 240const struct inode_operations udf_file_inode_operations = {
221 .truncate = udf_truncate, 241 .truncate = udf_truncate,
242 .setattr = udf_setattr,
222}; 243};