Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261398AbVETOrQ (ORCPT ); Fri, 20 May 2005 10:47:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261389AbVETOrQ (ORCPT ); Fri, 20 May 2005 10:47:16 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:57483 "EHLO parcelfarce.linux.theplanet.co.uk") by vger.kernel.org with ESMTP id S261382AbVETOrL (ORCPT ); Fri, 20 May 2005 10:47:11 -0400 Date: Fri, 20 May 2005 15:47:37 +0100 From: Al Viro To: Miklos Szeredi Cc: akpm@osdl.org, dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] namespace.c: cleanup in mark_mounts_for_expiry() Message-ID: <20050520144737.GR29811@parcelfarce.linux.theplanet.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1027 Lines: 21 On Fri, May 20, 2005 at 03:54:51PM +0200, Miklos Szeredi wrote: > [ fell in love with that function, now can't let go... ] > > This patch simplifies mark_mounts_for_expiry() by using detach_mnt() > instead of duplicating everything it does. > > It should be an equivalent transformation except for righting the > dput/mntput order. Looks sane. However, we still have a problem here - just what would happen if vfsmount is detached while we were grabbing namespace semaphore? Refcount alone is not useful here - we might be held by whoever had detached the vfsmount. IOW, we should check that it's still attached (i.e. that mnt->mnt_parent != mnt). If it's not - just leave it alone, do mntput() and let whoever holds it deal with the sucker. No need to put it back on lists. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/