diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 16:04:49 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 16:04:49 -0400 |
| commit | abb5a14fa20fdd400995926134b7be9eb8ce6048 (patch) | |
| tree | 085add41cae3193b8c8293d25b453fd1ecae0c19 /include | |
| parent | 911f9dab301e8583143c7e75b552eadd434ea0a8 (diff) | |
| parent | e55f1d1d13e7f1c364672d667d78fd1f640ab9f9 (diff) | |
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro:
"Assorted misc bits and pieces.
There are several single-topic branches left after this (rename2
series from Miklos, current_time series from Deepa Dinamani, xattr
series from Andreas, uaccess stuff from from me) and I'd prefer to
send those separately"
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (39 commits)
proc: switch auxv to use of __mem_open()
hpfs: support FIEMAP
cifs: get rid of unused arguments of CIFSSMBWrite()
posix_acl: uapi header split
posix_acl: xattr representation cleanups
fs/aio.c: eliminate redundant loads in put_aio_ring_file
fs/internal.h: add const to ns_dentry_operations declaration
compat: remove compat_printk()
fs/buffer.c: make __getblk_slow() static
proc: unsigned file descriptors
fs/file: more unsigned file descriptors
fs: compat: remove redundant check of nr_segs
cachefiles: Fix attempt to read i_blocks after deleting file [ver #2]
cifs: don't use memcpy() to copy struct iov_iter
get rid of separate multipage fault-in primitives
fs: Avoid premature clearing of capabilities
fs: Give dentry to inode_change_ok() instead of inode
fuse: Propagate dentry down to inode_change_ok()
ceph: Propagate dentry down to inode_change_ok()
xfs: Propagate dentry down to inode_change_ok()
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/compat.h | 1 | ||||
| -rw-r--r-- | include/linux/dcache.h | 5 | ||||
| -rw-r--r-- | include/linux/fdtable.h | 6 | ||||
| -rw-r--r-- | include/linux/fs.h | 22 | ||||
| -rw-r--r-- | include/linux/fsnotify.h | 14 | ||||
| -rw-r--r-- | include/linux/pagemap.h | 54 | ||||
| -rw-r--r-- | include/linux/posix_acl.h | 23 | ||||
| -rw-r--r-- | include/linux/posix_acl_xattr.h | 31 | ||||
| -rw-r--r-- | include/linux/uio.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/Kbuild | 2 | ||||
| -rw-r--r-- | include/uapi/linux/fs.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/posix_acl.h | 39 | ||||
| -rw-r--r-- | include/uapi/linux/posix_acl_xattr.h | 38 |
13 files changed, 123 insertions, 114 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index f964ef79e0ad..63609398ef9f 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -432,7 +432,6 @@ asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | |||
| 432 | 432 | ||
| 433 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 433 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
| 434 | 434 | ||
| 435 | extern __printf(1, 2) int compat_printk(const char *fmt, ...); | ||
| 436 | extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat); | 435 | extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat); |
| 437 | extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set); | 436 | extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set); |
| 438 | 437 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 5ff3e9a4fe5f..5beed7b30561 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -584,9 +584,10 @@ static inline struct dentry *d_real(struct dentry *dentry, | |||
| 584 | * If dentry is on an union/overlay, then return the underlying, real inode. | 584 | * If dentry is on an union/overlay, then return the underlying, real inode. |
| 585 | * Otherwise return d_inode(). | 585 | * Otherwise return d_inode(). |
| 586 | */ | 586 | */ |
| 587 | static inline struct inode *d_real_inode(struct dentry *dentry) | 587 | static inline struct inode *d_real_inode(const struct dentry *dentry) |
| 588 | { | 588 | { |
| 589 | return d_backing_inode(d_real(dentry, NULL, 0)); | 589 | /* This usage of d_real() results in const dentry */ |
| 590 | return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0)); | ||
| 590 | } | 591 | } |
| 591 | 592 | ||
| 592 | 593 | ||
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 5295535b60c6..aca2a6a1d035 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
| @@ -30,12 +30,12 @@ struct fdtable { | |||
| 30 | struct rcu_head rcu; | 30 | struct rcu_head rcu; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | static inline bool close_on_exec(int fd, const struct fdtable *fdt) | 33 | static inline bool close_on_exec(unsigned int fd, const struct fdtable *fdt) |
| 34 | { | 34 | { |
| 35 | return test_bit(fd, fdt->close_on_exec); | 35 | return test_bit(fd, fdt->close_on_exec); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | static inline bool fd_is_open(int fd, const struct fdtable *fdt) | 38 | static inline bool fd_is_open(unsigned int fd, const struct fdtable *fdt) |
| 39 | { | 39 | { |
| 40 | return test_bit(fd, fdt->open_fds); | 40 | return test_bit(fd, fdt->open_fds); |
| 41 | } | 41 | } |
| @@ -57,7 +57,7 @@ struct files_struct { | |||
| 57 | * written part on a separate cache line in SMP | 57 | * written part on a separate cache line in SMP |
| 58 | */ | 58 | */ |
| 59 | spinlock_t file_lock ____cacheline_aligned_in_smp; | 59 | spinlock_t file_lock ____cacheline_aligned_in_smp; |
| 60 | int next_fd; | 60 | unsigned int next_fd; |
| 61 | unsigned long close_on_exec_init[1]; | 61 | unsigned long close_on_exec_init[1]; |
| 62 | unsigned long open_fds_init[1]; | 62 | unsigned long open_fds_init[1]; |
| 63 | unsigned long full_fds_bits_init[1]; | 63 | unsigned long full_fds_bits_init[1]; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b04883e74579..4ba5957ae089 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -63,7 +63,7 @@ extern void __init files_maxfiles_init(void); | |||
| 63 | 63 | ||
| 64 | extern struct files_stat_struct files_stat; | 64 | extern struct files_stat_struct files_stat; |
| 65 | extern unsigned long get_max_files(void); | 65 | extern unsigned long get_max_files(void); |
| 66 | extern int sysctl_nr_open; | 66 | extern unsigned int sysctl_nr_open; |
| 67 | extern struct inodes_stat_t inodes_stat; | 67 | extern struct inodes_stat_t inodes_stat; |
| 68 | extern int leases_enable, lease_break_time; | 68 | extern int leases_enable, lease_break_time; |
| 69 | extern int sysctl_protected_symlinks; | 69 | extern int sysctl_protected_symlinks; |
| @@ -224,6 +224,7 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
| 224 | #define ATTR_KILL_PRIV (1 << 14) | 224 | #define ATTR_KILL_PRIV (1 << 14) |
| 225 | #define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ | 225 | #define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ |
| 226 | #define ATTR_TIMES_SET (1 << 16) | 226 | #define ATTR_TIMES_SET (1 << 16) |
| 227 | #define ATTR_TOUCH (1 << 17) | ||
| 227 | 228 | ||
| 228 | /* | 229 | /* |
| 229 | * Whiteout is represented by a char device. The following constants define the | 230 | * Whiteout is represented by a char device. The following constants define the |
| @@ -1064,6 +1065,18 @@ struct file_lock_context { | |||
| 1064 | 1065 | ||
| 1065 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | 1066 | extern void send_sigio(struct fown_struct *fown, int fd, int band); |
| 1066 | 1067 | ||
| 1068 | /* | ||
| 1069 | * Return the inode to use for locking | ||
| 1070 | * | ||
| 1071 | * For overlayfs this should be the overlay inode, not the real inode returned | ||
| 1072 | * by file_inode(). For any other fs file_inode(filp) and locks_inode(filp) are | ||
| 1073 | * equal. | ||
| 1074 | */ | ||
| 1075 | static inline struct inode *locks_inode(const struct file *f) | ||
| 1076 | { | ||
| 1077 | return f->f_path.dentry->d_inode; | ||
| 1078 | } | ||
| 1079 | |||
| 1067 | #ifdef CONFIG_FILE_LOCKING | 1080 | #ifdef CONFIG_FILE_LOCKING |
| 1068 | extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *); | 1081 | extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *); |
| 1069 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | 1082 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, |
| @@ -1251,7 +1264,7 @@ static inline struct dentry *file_dentry(const struct file *file) | |||
| 1251 | 1264 | ||
| 1252 | static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) | 1265 | static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) |
| 1253 | { | 1266 | { |
| 1254 | return locks_lock_inode_wait(file_inode(filp), fl); | 1267 | return locks_lock_inode_wait(locks_inode(filp), fl); |
| 1255 | } | 1268 | } |
| 1256 | 1269 | ||
| 1257 | struct fasync_struct { | 1270 | struct fasync_struct { |
| @@ -2006,7 +2019,6 @@ enum file_time_flags { | |||
| 2006 | S_VERSION = 8, | 2019 | S_VERSION = 8, |
| 2007 | }; | 2020 | }; |
| 2008 | 2021 | ||
| 2009 | extern bool atime_needs_update(const struct path *, struct inode *); | ||
| 2010 | extern void touch_atime(const struct path *); | 2022 | extern void touch_atime(const struct path *); |
| 2011 | static inline void file_accessed(struct file *file) | 2023 | static inline void file_accessed(struct file *file) |
| 2012 | { | 2024 | { |
| @@ -2155,7 +2167,7 @@ static inline int mandatory_lock(struct inode *ino) | |||
| 2155 | 2167 | ||
| 2156 | static inline int locks_verify_locked(struct file *file) | 2168 | static inline int locks_verify_locked(struct file *file) |
| 2157 | { | 2169 | { |
| 2158 | if (mandatory_lock(file_inode(file))) | 2170 | if (mandatory_lock(locks_inode(file))) |
| 2159 | return locks_mandatory_locked(file); | 2171 | return locks_mandatory_locked(file); |
| 2160 | return 0; | 2172 | return 0; |
| 2161 | } | 2173 | } |
| @@ -2993,7 +3005,7 @@ extern int buffer_migrate_page(struct address_space *, | |||
| 2993 | #define buffer_migrate_page NULL | 3005 | #define buffer_migrate_page NULL |
| 2994 | #endif | 3006 | #endif |
| 2995 | 3007 | ||
| 2996 | extern int inode_change_ok(const struct inode *, struct iattr *); | 3008 | extern int setattr_prepare(struct dentry *, struct iattr *); |
| 2997 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | 3009 | extern int inode_newsize_ok(const struct inode *, loff_t offset); |
| 2998 | extern void setattr_copy(struct inode *inode, const struct iattr *attr); | 3010 | extern void setattr_copy(struct inode *inode, const struct iattr *attr); |
| 2999 | 3011 | ||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index eed9e853a06f..b8bcc058e031 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -29,7 +29,11 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3 | |||
| 29 | static inline int fsnotify_perm(struct file *file, int mask) | 29 | static inline int fsnotify_perm(struct file *file, int mask) |
| 30 | { | 30 | { |
| 31 | struct path *path = &file->f_path; | 31 | struct path *path = &file->f_path; |
| 32 | struct inode *inode = file_inode(file); | 32 | /* |
| 33 | * Do not use file_inode() here or anywhere in this file to get the | ||
| 34 | * inode. That would break *notity on overlayfs. | ||
| 35 | */ | ||
| 36 | struct inode *inode = path->dentry->d_inode; | ||
| 33 | __u32 fsnotify_mask = 0; | 37 | __u32 fsnotify_mask = 0; |
| 34 | int ret; | 38 | int ret; |
| 35 | 39 | ||
| @@ -173,7 +177,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
| 173 | static inline void fsnotify_access(struct file *file) | 177 | static inline void fsnotify_access(struct file *file) |
| 174 | { | 178 | { |
| 175 | struct path *path = &file->f_path; | 179 | struct path *path = &file->f_path; |
| 176 | struct inode *inode = file_inode(file); | 180 | struct inode *inode = path->dentry->d_inode; |
| 177 | __u32 mask = FS_ACCESS; | 181 | __u32 mask = FS_ACCESS; |
| 178 | 182 | ||
| 179 | if (S_ISDIR(inode->i_mode)) | 183 | if (S_ISDIR(inode->i_mode)) |
| @@ -191,7 +195,7 @@ static inline void fsnotify_access(struct file *file) | |||
| 191 | static inline void fsnotify_modify(struct file *file) | 195 | static inline void fsnotify_modify(struct file *file) |
| 192 | { | 196 | { |
| 193 | struct path *path = &file->f_path; | 197 | struct path *path = &file->f_path; |
| 194 | struct inode *inode = file_i | ||
