From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [patch 3/7] fs, notify: Add file handle entry into inotify_inode_mark Date: Wed, 14 Nov 2012 10:46:15 +0400 Message-ID: <20121114064615.GB16685@moon> References: <20121112101440.665694060@openvz.org> <20121112101845.839702715@openvz.org> <20121112165540.2ec39f50.akpm@linux-foundation.org> <20121113072057.GC6511@moon> <20121112234001.009b2ae3.akpm@linux-foundation.org> <20121113080032.GF6511@moon> <20121113143808.8d198bfe.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro , Alexey Dobriyan , Pavel Emelyanov , James Bottomley , Matthew Helsley , aneesh.kumar@linux.vnet.ibm.com, bfields@fieldses.org To: Andrew Morton Return-path: Content-Disposition: inline In-Reply-To: <20121113143808.8d198bfe.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Nov 13, 2012 at 02:38:08PM -0800, Andrew Morton wrote: > On Tue, 13 Nov 2012 12:00:32 +0400 > Cyrill Gorcunov wrote: > > > > Dumb question: do we really need inotify_inode_mark.fhandle at all? > > > What prevents us from assembling this info on demand when ->show_fdinfo() is > > > called? > > > > exportfs requires the dentry to be passed as an argument while inotify works > > with inodes instead and at moment of show-fdinfo the target dentry might be > > already deleted but inode yet present as far as I remember. > > How can the c/r restore code reestablish the inode data if the dentry > isn't there any more? By "deleted" I meant deleted from dcache, thus when we call for open_by_handle_at with fhandle, the kernel reconstruct the path and we simply read the /proc/self/fd/ link, and then pass this path to inotify_add_watch.