aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
commitd895cb1af15c04c522a25c79cc429076987c089b (patch)
tree895dc9157e28f603d937a58be664e4e440d5530c /kernel
parent9626357371b519f2b955fef399647181034a77fe (diff)
parentd3d009cb965eae7e002ea5badf603ea8f4c34915 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c2
-rw-r--r--kernel/cgroup.c6
-rw-r--r--kernel/events/core.c2
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/irq/proc.c2
-rw-r--r--kernel/module.c2
-rw-r--r--kernel/nsproxy.c2
-rw-r--r--kernel/relay.c4
-rw-r--r--kernel/sys.c8
-rw-r--r--kernel/sysctl_binary.c39
10 files changed, 22 insertions, 47 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index e8b1627ab9c7..b9bd7f098ee5 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -205,7 +205,7 @@ static int acct_on(struct filename *pathname)
205 if (IS_ERR(file)) 205 if (IS_ERR(file))
206 return PTR_ERR(file); 206 return PTR_ERR(file);
207 207
208 if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) { 208 if (!S_ISREG(file_inode(file)->i_mode)) {
209 filp_close(file, NULL); 209 filp_close(file, NULL);
210 return -EACCES; 210 return -EACCES;
211 } 211 }
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index b5c64327e712..fb2fb11fbb25 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2645,7 +2645,7 @@ static struct dentry *cgroup_lookup(struct inode *dir, struct dentry *dentry, un
2645 */ 2645 */
2646static inline struct cftype *__file_cft(struct file *file) 2646static inline struct cftype *__file_cft(struct file *file)
2647{ 2647{
2648 if (file->f_dentry->d_inode->i_fop != &cgroup_file_operations) 2648 if (file_inode(file)->i_fop != &cgroup_file_operations)
2649 return ERR_PTR(-EINVAL); 2649 return ERR_PTR(-EINVAL);
2650 return __d_cft(file->f_dentry); 2650 return __d_cft(file->f_dentry);
2651} 2651}
@@ -3902,7 +3902,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
3902 3902
3903 /* the process need read permission on control file */ 3903 /* the process need read permission on control file */
3904 /* AV: shouldn't we check that it's been opened for read instead? */ 3904 /* AV: shouldn't we check that it's been opened for read instead? */
3905 ret = inode_permission(cfile->f_path.dentry->d_inode, MAY_READ); 3905 ret = inode_permission(file_inode(cfile), MAY_READ);
3906 if (ret < 0) 3906 if (ret < 0)
3907 goto fail; 3907 goto fail;
3908 3908
@@ -5489,7 +5489,7 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id)
5489 struct inode *inode; 5489 struct inode *inode;
5490 struct cgroup_subsys_state *css; 5490 struct cgroup_subsys_state *css;
5491 5491
5492 inode = f->f_dentry->d_inode; 5492 inode = file_inode(f);
5493 /* check in cgroup filesystem dir */ 5493 /* check in cgroup filesystem dir */
5494 if (inode->i_op != &cgroup_dir_inode_operations) 5494 if (inode->i_op != &cgroup_dir_inode_operations)
5495 return ERR_PTR(-EBADF); 5495 return ERR_PTR(-EBADF);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 5c75791d7269..ccc457e36354 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3691,7 +3691,7 @@ unlock:
3691 3691
3692static int perf_fasync(int fd, struct file *filp, int on) 3692static int perf_fasync(int fd, struct file *filp, int on)
3693{ 3693{
3694 struct inode *inode = filp->f_path.dentry->d_inode; 3694 struct inode *inode = file_inode(filp);
3695 struct perf_event *event = filp->private_data; 3695 struct perf_event *event = filp->private_data;
3696 int retval; 3696 int retval;
3697 3697
diff --git a/kernel/fork.c b/kernel/fork.c
index 4133876d8cd2..8f62b2a0f120 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -413,7 +413,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
413 tmp->vm_next = tmp->vm_prev = NULL; 413 tmp->vm_next = tmp->vm_prev = NULL;
414 file = tmp->vm_file; 414 file = tmp->vm_file;
415 if (file) { 415 if (file) {
416 struct inode *inode = file->f_path.dentry->d_inode; 416 struct inode *inode = file_inode(file);
417 struct address_space *mapping = file->f_mapping; 417 struct address_space *mapping = file->f_mapping;
418 418
419 get_file(file); 419 get_file(file);
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 4bd4faa6323a..397db02209ed 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -76,7 +76,7 @@ static int irq_affinity_list_proc_show(struct seq_file *m, void *v)
76static ssize_t write_irq_affinity(int type, struct file *file, 76static ssize_t write_irq_affinity(int type, struct file *file,
77 const char __user *buffer, size_t count, loff_t *pos) 77 const char __user *buffer, size_t count, loff_t *pos)
78{ 78{
79 unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data; 79 unsigned int irq = (int)(long)PDE(file_inode(file))->data;
80 cpumask_var_t new_value; 80 cpumask_var_t new_value;
81 int err; 81 int err;
82 82
diff --git a/kernel/module.c b/kernel/module.c
index 921bed4794e9..0925c9a71975 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2541,7 +2541,7 @@ static int copy_module_from_fd(int fd, struct load_info *info)
2541 if (err) 2541 if (err)
2542 goto out; 2542 goto out;
2543 2543
2544 err = vfs_getattr(file->f_vfsmnt, file->f_dentry, &stat); 2544 err = vfs_getattr(&file->f_path, &stat);
2545 if (err) 2545 if (err)
2546 goto out; 2546 goto out;
2547 2547
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index b781e66a8f2c..afc0456f227a 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -250,7 +250,7 @@ SYSCALL_DEFINE2(setns, int, fd, int, nstype)
250 return PTR_ERR(file); 250 return PTR_ERR(file);
251 251
252 err = -EINVAL; 252 err = -EINVAL;
253 ei = PROC_I(file->f_dentry->d_inode); 253 ei = PROC_I(file_inode(file));
254 ops = ei->ns_ops; 254 ops = ei->ns_ops;
255 if (nstype && (ops->type != nstype)) 255 if (nstype && (ops->type != nstype))
256 goto out; 256 goto out;
diff --git a/kernel/relay.c b/kernel/relay.c
index e8cd2027abbd..01ab081ac53a 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1139,7 +1139,7 @@ static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos,
1139 if (!desc->count) 1139 if (!desc->count)
1140 return 0; 1140 return 0;
1141 1141
1142 mutex_lock(&filp->f_path.dentry->d_inode->i_mutex); 1142 mutex_lock(&file_inode(filp)->i_mutex);
1143 do { 1143 do {
1144 if (!relay_file_read_avail(buf, *ppos)) 1144 if (!relay_file_read_avail(buf, *ppos))
1145 break; 1145 break;
@@ -1159,7 +1159,7 @@ static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos,
1159 *ppos = relay_file_read_end_pos(buf, read_start, ret); 1159 *ppos = relay_file_read_end_pos(buf, read_start, ret);
1160 } 1160 }
1161 } while (desc->count && ret); 1161 } while (desc->count && ret);
1162 mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex); 1162 mutex_unlock(&file_inode(filp)->i_mutex);
1163 1163
1164 return desc->written; 1164 return desc->written;
1165} 1165}
diff --git a/kernel/sys.c b/kernel/sys.c
index 2e18d33ca775..e10566bee399 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1794,14 +1794,14 @@ SYSCALL_DEFINE1(umask, int, mask)
1794static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) 1794static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
1795{ 1795{
1796 struct fd exe; 1796 struct fd exe;
1797 struct dentry *dentry; 1797 struct inode *inode;
1798 int err; 1798 int err;
1799 1799
1800 exe = fdget(fd); 1800 exe = fdget(fd);
1801 if (!exe.file) 1801 if (!exe.file)
1802 return -EBADF; 1802 return -EBADF;
1803 1803
1804 dentry = exe.file->f_path.dentry; 1804 inode = file_inode(exe.file);
1805 1805
1806 /* 1806 /*
1807 * Because the original mm->exe_file points to executable file, make 1807 * Because the original mm->exe_file points to executable file, make
@@ -1809,11 +1809,11 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
1809 * overall picture. 1809 * overall picture.
1810 */ 1810 */
1811 err = -EACCES; 1811 err = -EACCES;
1812 if (!S_ISREG(dentry->d_inode->i_mode) || 1812 if (!S_ISREG(inode->i_mode) ||
1813 exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC) 1813 exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC)
1814 goto exit; 1814 goto exit;
1815 1815
1816 err = inode_permission(dentry->d_inode, MAY_EXEC); 1816 err = inode_permission(inode, MAY_EXEC);