aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-05-11 17:44:25 -0400
committerEric W. Biederman <ebiederm@xmission.com>2015-07-01 11:36:41 -0400
commiteb6d38d5427b3ad42f5268da0f1dd31bb0af1264 (patch)
tree1fb54abb73c369444d6b84f12e3eff670c0a5d64 /fs/proc/inode.c
parentf9bd6733d3f11e24f3949becf277507d422ee1eb (diff)
proc: Allow creating permanently empty directories that serve as mount points
Add a new function proc_create_mount_point that when used to creates a directory that can not be added to. Add a new function is_empty_pde to test if a function is a mount point. Update the code to use make_empty_dir_inode when reporting a permanently empty directory to the vfs. Update the code to not allow adding to permanently empty directories. Update /proc/openprom and /proc/fs/nfsd to be permanently empty directories. Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r--fs/proc/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 8272aaba1bb0..e3eb5524639f 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -423,6 +423,10 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
423 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 423 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
424 PROC_I(inode)->pde = de; 424 PROC_I(inode)->pde = de;
425 425
426 if (is_empty_pde(de)) {
427 make_empty_dir_inode(inode);
428 return inode;
429 }
426 if (de->mode) { 430 if (de->mode) {
427 inode->i_mode = de->mode; 431 inode->i_mode = de->mode;
428 inode->i_uid = de->uid; 432 inode->i_uid = de->uid;