From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kinglong Mee Subject: Re: [PATCH 4/6 v9] fs: New helper legitimize_mntget() for getting a legitimize mnt Date: Fri, 28 Aug 2015 07:02:39 +0800 Message-ID: <55DF970F.6080308@gmail.com> References: <55D2DBF6.3010406@gmail.com> <55D2DD17.7050504@gmail.com> <20150819145650.46352023@noble> <20150819050245.GC18890@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "J. Bruce Fields" , "linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Trond Myklebust , kinglongmee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: Al Viro , NeilBrown Return-path: In-Reply-To: <20150819050245.GC18890-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On 8/19/2015 13:02, Al Viro wrote: > On Wed, Aug 19, 2015 at 02:56:50PM +1000, NeilBrown wrote: >> If not, we need to clean up and try again. >> To do this we need to check MNT_SYNC_UMOUNT. >> If that is clear it is safe and best to call mntput() on the mnt. >> If it is set, then we just do the mnt_add_count(mnt, -1) and give up >> completely. > > It's more subtle, actually. See my reply upthread for details, but > basically we rely on rcu_read_lock() held since before that MNT_SYNC_UMOUNT > had been set, making synchronize_rcu() in namespace_unlock() a guaranteed > delay of the final mntput until after we have returned. > Thanks for the comments. I will update this patch according to Neil's comments and __legitimize_mnt. thanks, Kinglong Mee -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html