diff options
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -999,12 +999,12 @@ struct file *create_write_pipe(int flags) | |||
999 | goto err; | 999 | goto err; |
1000 | 1000 | ||
1001 | err = -ENOMEM; | 1001 | err = -ENOMEM; |
1002 | path.dentry = d_alloc(pipe_mnt->mnt_sb->s_root, &name); | 1002 | path.dentry = d_alloc_pseudo(pipe_mnt->mnt_sb, &name); |
1003 | if (!path.dentry) | 1003 | if (!path.dentry) |
1004 | goto err_inode; | 1004 | goto err_inode; |
1005 | path.mnt = mntget(pipe_mnt); | 1005 | path.mnt = mntget(pipe_mnt); |
1006 | 1006 | ||
1007 | path.dentry->d_op = &pipefs_dentry_operations; | 1007 | d_set_d_op(path.dentry, &pipefs_dentry_operations); |
1008 | d_instantiate(path.dentry, inode); | 1008 | d_instantiate(path.dentry, inode); |
1009 | 1009 | ||
1010 | err = -ENFILE; | 1010 | err = -ENFILE; |
@@ -1253,6 +1253,10 @@ out: | |||
1253 | return ret; | 1253 | return ret; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | static const struct super_operations pipefs_ops = { | ||
1257 | .destroy_inode = free_inode_nonrcu, | ||
1258 | }; | ||
1259 | |||
1256 | /* | 1260 | /* |
1257 | * pipefs should _never_ be mounted by userland - too much of security hassle, | 1261 | * pipefs should _never_ be mounted by userland - too much of security hassle, |
1258 | * no real gain from having the whole whorehouse mounted. So we don't need | 1262 | * no real gain from having the whole whorehouse mounted. So we don't need |
@@ -1262,7 +1266,7 @@ out: | |||
1262 | static struct dentry *pipefs_mount(struct file_system_type *fs_type, | 1266 | static struct dentry *pipefs_mount(struct file_system_type *fs_type, |
1263 | int flags, const char *dev_name, void *data) | 1267 | int flags, const char *dev_name, void *data) |
1264 | { | 1268 | { |
1265 | return mount_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC); | 1269 | return mount_pseudo(fs_type, "pipe:", &pipefs_ops, PIPEFS_MAGIC); |
1266 | } | 1270 | } |
1267 | 1271 | ||
1268 | static struct file_system_type pipe_fs_type = { | 1272 | static struct file_system_type pipe_fs_type = { |
@@ -1288,7 +1292,7 @@ static int __init init_pipe_fs(void) | |||
1288 | static void __exit exit_pipe_fs(void) | 1292 | static void __exit exit_pipe_fs(void) |
1289 | { | 1293 | { |
1290 | unregister_filesystem(&pipe_fs_type); | 1294 | unregister_filesystem(&pipe_fs_type); |
1291 | mntput(pipe_mnt); | 1295 | mntput_long(pipe_mnt); |
1292 | } | 1296 | } |
1293 | 1297 | ||
1294 | fs_initcall(init_pipe_fs); | 1298 | fs_initcall(init_pipe_fs); |