From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: How to unmount mounts corresponding to super_block structure? Date: Wed, 27 Feb 2013 07:43:44 +0000 Message-ID: <20130227074344.GO4503@ZenIV.linux.org.uk> References: <20130227065641.GN4503@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Anatol Pomozov Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:34036 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348Ab3B0Hnp (ORCPT ); Wed, 27 Feb 2013 02:43:45 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Feb 26, 2013 at 11:19:30PM -0800, Anatol Pomozov wrote: > Hi > > On Tue, Feb 26, 2013 at 10:56 PM, Al Viro wrote: > > Simple: don't. This is fundamentally wrong thing to do. Not to mention > > anything else, there may be more than one namespace out there. This > > operation makes no sense. > > Yes I understand that there can be multiple namespaces. And I am fine > with unmounting only in the current namespace. It is actually how > libfuse currently implemented - it calls umount() on the mount point > path, so it leaves 1) bind mounts 2) mounts in other namespaces > untouched. > > Another ugly-but-working solution for fuse would be pass mountpoint > path as a mount option and store it to super_block. Then in > fuse_dev_release() call sys_umount(). Observe mount --move... There is no promise that it'll stay mounted where it used to be. BTW, what about somebody having cloned the entire namespace? Or spread the sucker via shared subtree stuff to another namespace, later remounted private, etc. "All places where the filesystem is mounted" is about as good a notion as "all pathnames of a file". Sorry. Besides, I _really_ doubt that it's a sane idea to start with; consider something like mount --bind empty_directory . Having it suddenly exposed without your explicit action is not a good thing. As the matter of fact, something very similar had been outright NAKed by Linus and I agree with his arguments...