diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 22:17:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 22:17:50 -0400 |
commit | be88751f320a716a4327596adfe834e162c14532 (patch) | |
tree | 4015f6d1da204e6228dfcbc3984ac9ddf7d988de /fs/udf/file.c | |
parent | 5e4d659713f52c1c9dfc2fea9d319b80a53d4bc9 (diff) | |
parent | b91ed9d8082c394dda63f94f935219cd0a565938 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull misc filesystem updates from Jan Kara:
"udf, ext2, quota, fsnotify fixes & cleanups:
- udf fixes for handling of media without uid/gid
- udf fixes for some corner cases in parsing of volume recognition
sequence
- improvements of fsnotify handling of ENOMEM
- new ioctl to allow setting of watch descriptor id for inotify (for
checkpoint - restart)
- small ext2, reiserfs, quota cleanups"
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Kill an unused extern entry form quota.h
reiserfs: Remove VLA from fs/reiserfs/reiserfs.h
udf: fix potential refcnt problem of nls module
ext2: change return code to -ENOMEM when failing memory allocation
udf: Do not mark possibly inconsistent filesystems as closed
fsnotify: Let userspace know about lost events due to ENOMEM
fanotify: Avoid lost events due to ENOMEM for unlimited queues
udf: Remove never implemented mount options
udf: Update mount option documentation
udf: Provide saner default for invalid uid / gid
udf: Clean up handling of invalid uid/gid
udf: Apply uid/gid mount options also to new inodes & chown
udf: Ignore [ug]id=ignore mount options
udf: Fix handling of Partition Descriptors
udf: Unify common handling of descriptors
udf: Convert descriptor index definitions to enum
udf: Allow volume descriptor sequence to be terminated by unrecorded block
udf: Simplify handling of Volume Descriptor Pointers
udf: Fix off-by-one in volume descriptor sequence length
inotify: Extend ioctl to allow to request id of new watch descriptor
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r-- | fs/udf/file.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index 356c2bf148a5..cd31e4f6d6da 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -257,12 +257,22 @@ const struct file_operations udf_file_operations = { | |||
257 | static int udf_setattr(struct dentry *dentry, struct iattr *attr) | 257 | static int udf_setattr(struct dentry *dentry, struct iattr *attr) |
258 | { | 258 | { |
259 | struct inode *inode = d_inode(dentry); | 259 | struct inode *inode = d_inode(dentry); |
260 | struct super_block *sb = inode->i_sb; | ||
260 | int error; | 261 | int error; |
261 | 262 | ||
262 | error = setattr_prepare(dentry, attr); | 263 | error = setattr_prepare(dentry, attr); |
263 | if (error) | 264 | if (error) |
264 | return error; | 265 | return error; |
265 | 266 | ||
267 | if ((attr->ia_valid & ATTR_UID) && | ||
268 | UDF_QUERY_FLAG(sb, UDF_FLAG_UID_SET) && | ||
269 | !uid_eq(attr->ia_uid, UDF_SB(sb)->s_uid)) | ||
270 | return -EPERM; | ||
271 | if ((attr->ia_valid & ATTR_GID) && | ||
272 | UDF_QUERY_FLAG(sb, UDF_FLAG_GID_SET) && | ||
273 | !gid_eq(attr->ia_gid, UDF_SB(sb)->s_gid)) | ||
274 | return -EPERM; | ||
275 | |||
266 | if ((attr->ia_valid & ATTR_SIZE) && | 276 | if ((attr->ia_valid & ATTR_SIZE) && |
267 | attr->ia_size != i_size_read(inode)) { | 277 | attr->ia_size != i_size_read(inode)) { |
268 | error = udf_setsize(inode, attr->ia_size); | 278 | error = udf_setsize(inode, attr->ia_size); |