From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751551AbdIOXns (ORCPT ); Fri, 15 Sep 2017 19:43:48 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45074 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbdIOXnr (ORCPT ); Fri, 15 Sep 2017 19:43:47 -0400 Date: Sat, 16 Sep 2017 00:43:43 +0100 From: Al Viro To: Jaegeuk Kim Cc: "Theodore Ts'o" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH] vfs: introduce UMOUNT_WAIT which waits for umount completion Message-ID: <20170915234343.GA5426@ZenIV.linux.org.uk> References: <20170914013017.GP5426@ZenIV.linux.org.uk> <20170914183723.GA17131@ZenIV.linux.org.uk> <20170914191447.GA9428@jaegeuk-macbookpro.roam.corp.google.com> <20170915001939.GA20096@jaegeuk-macbookpro.roam.corp.google.com> <20170915020607.GW5426@ZenIV.linux.org.uk> <20170915034518.GB20096@jaegeuk-macbookpro.roam.corp.google.com> <20170915042137.GX5426@ZenIV.linux.org.uk> <20170915184433.GA32008@jaegeuk-macbookpro.roam.corp.google.com> <20170915221238.js6elr5jmj4mgt67@thunk.org> <20170915232911.GA44998@jaegeuk-macbookpro.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170915232911.GA44998@jaegeuk-macbookpro.roam.corp.google.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 04:29:11PM -0700, Jaegeuk Kim wrote: > The mntput() in delayed_fput() is the last function call. So before that moment, > sys_umount() may see mnt_get_count() as 2, so it avoids EBUSY condition. I'm not > sure why it check over 2 tho. Because it has just grabbed a reference itself, in addition to the one that keeps the damn thing alive (due to being mounted). So it bloody well should have triggered -EBUSY, if they refer to the same vfsmount.