Commit d70ef97b authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Linus Torvalds

fs/pipe.c: add ->statfs callback for pipefs

Currently a statfs on a pipe's /proc/<pid>/fd/ link returns -ENOSYS.  Wire
pipfs up so that the statfs succeeds.

This is required by checkpoint-restart in the userspace to make it
possible to distinguish pipes from fifos.

When we dump information about task's open files we use the /proc/pid/fd
directoy's symlinks and the fact that opening any of them gives us exactly
the same dentry->inode pair as the original process has.  Now if a task
we're dumping has opened pipe and fifo we need to detect this and act
accordingly.  Knowing that an fd with type S_ISFIFO resides on a pipefs is
the most precise way.
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
Reviewed-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a8aff21e
...@@ -1254,6 +1254,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1254,6 +1254,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
static const struct super_operations pipefs_ops = { static const struct super_operations pipefs_ops = {
.destroy_inode = free_inode_nonrcu, .destroy_inode = free_inode_nonrcu,
.statfs = simple_statfs,
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment