From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonardo Chiquitto Subject: Re: When ghosting is enabled, failed mounts by AutoFS leave broken directories Date: Tue, 9 Oct 2012 08:08:18 -0300 Message-ID: References: <1348539229.2307.26.camel@perseus.themaw.net> <1348650908.2281.21.camel@perseus.themaw.net> <1348707890.2343.11.camel@perseus.themaw.net> <1348720504.2563.4.camel@perseus.themaw.net> <5064A225.4090607@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Ian Kent , autofs@vger.kernel.org, linux-fsdevel@vger.kernel.org, miklos@szeredi.hu To: Michael Tokarev Return-path: Received: from mail-qc0-f174.google.com ([209.85.216.174]:60576 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116Ab2JILIT (ORCPT ); Tue, 9 Oct 2012 07:08:19 -0400 In-Reply-To: <5064A225.4090607@msgid.tls.msk.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Sep 27, 2012 at 3:59 PM, Michael Tokarev wrote: > On 27.09.2012 22:35, Leonardo Chiquitto wrote: >> On Thu, Sep 27, 2012 at 1:35 AM, Ian Kent wrote: > [] >>> I can confirm that there is no directory removal and re-create going on. >>> >>> Checking for that lead me to discover this mistake which fixes the >>> symptom we're seeing: >>> >>> autofs4 - fix reset pending flag on mount fail >>> >>> From: Ian Kent >>> >>> In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING >>> mount pending flag is not cleared. >>> >>> One effect of this is when using the "browse" option, directory entry >>> attributes show up with all "?"s due to the incorrect callback and >>> subsequent failure return (when in fact no callback should be made). >> >> Reported-and-tested-by: Leonardo Chiquitto >> >> Ian, >> >> I just tested the patch here and confirmed it works perfectly. > > Is it a -stable (kernel) material? This and the previous change, > the locking logic fix/rework? Both appears to be needed for all > current 3.x stable trees... IMO, at least this one should be submitted to stable after it reaches mainline. Leonardo >>> fs/autofs4/root.c | 6 ++++-- >>> 1 files changed, 4 insertions(+), 2 deletions(-) >>> >>> >>> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c >>> index 75e5f1c..8c4292f 100644 >>> --- a/fs/autofs4/root.c >>> +++ b/fs/autofs4/root.c >>> @@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automount(struct path *path) >>> ino->flags |= AUTOFS_INF_PENDING; >>> spin_unlock(&sbi->fs_lock); >>> status = autofs4_mount_wait(dentry); >>> - if (status) >>> - return ERR_PTR(status); >>> spin_lock(&sbi->fs_lock); >>> ino->flags &= ~AUTOFS_INF_PENDING; >>> + if (status) { >>> + spin_unlock(&sbi->fs_lock); >>> + return ERR_PTR(status); >>> + } >>> } >>> done: >>> if (!(ino->flags & AUTOFS_INF_EXPIRING)) {