From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbcLDCH5 (ORCPT ); Sat, 3 Dec 2016 21:07:57 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:34456 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751894AbcLDCHy (ORCPT ); Sat, 3 Dec 2016 21:07:54 -0500 X-ME-Sender: X-Sasl-enc: ZC7gI1O789htpcKZ7ci0z0chi7zZUBjnY9IRteLCTk1v 1480817272 Message-ID: <1480817268.3157.4.camel@themaw.net> Subject: Re: [PATCH 1/7] vfs - merge path_is_mountpoint() and path_is_mountpoint_rcu() From: Ian Kent To: Al Viro Cc: Andrew Morton , autofs mailing list , Kernel Mailing List , "Eric W. Biederman" , linux-fsdevel , Omar Sandoval Date: Sun, 04 Dec 2016 10:07:48 +0800 In-Reply-To: <20161203051322.GA24765@ZenIV.linux.org.uk> References: <148029910861.27779.4517883721395202453.stgit@pluto.themaw.net> <20161203051322.GA24765@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2016-12-03 at 05:13 +0000, Al Viro wrote: > FWIW, I've folded that pile into vfs.git#work.autofs. > > Problems: > * (fixed) __path_is_mountpoint() should _not_ treat NULL from > __lookup_mnt() as "nothing's mounted there" until it has checked > that mount_lock hadn't been touched - mount --move on something unrelated > can race with lockless hash lookup and lead to false negatives. Right, looking at what you've done there the mistake is so obvious now! Thanks for helping with it. > * linux/mount.h might be the wrong place for path_is_mountpoint(). > Or it shouldn't be inlined.  I don't like the includes you've added there. > * path_has_submounts() is broken.  At the very least, it's > AB-BA between mount_lock and rename_lock.  I would suggest trying to > put read_seqlock_excl(&mount_lock) around the call of d_walk() in there, > and using __lookup_mnt() in the callback (without retries on the mount_lock, > of course - read_seqlock_excl done on the outside is enough).  I'm not sure > if it won't cause trouble with contention, though; that needs testing.  As > it is, that function is broken in #work.autofs, same as it is in -mm and > -next. Umm ... that's a much more obvious dumb mistake and what you've done there didn't occur to me even after you spelled it out, I'll take some time to digest it. And thanks for that one too. Ian