From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH resend] vfs: Add ->statfs callback for pipefs Date: Wed, 24 Aug 2011 12:33:17 +0400 Message-ID: <4E54B74D.7070407@parallels.com> References: <20110824080924.GG29452@sun> <20110824012328.f7bfc68a.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110824012328.f7bfc68a.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Andrew Morton Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , James Bottomley , Cyrill Gorcunov , "containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org" , Nathan Lynch , Al Viro , Tejun Heo , LINUXFS-ML , Daniel Lezcano List-Id: containers.vger.kernel.org > > OK, I give up - how does it work? > > > > So it appears that the statfs call would previously return -ENOSYS, but > with this change the statfs will succeed and userspace can then inspect > f_type. Yes? I will fix your changelog by adding a description along these > lines. Yes, the primary intention is to get the f_type. > And I'll ask you to fix it further by telling us why we want to do > this? The kernel has had this issue for a long time - why does it now > matter? This is required by checkpoint-restart in the userspace to make it possible to distinguish pipes from fifos. In more details: 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. Thanks, Pavel