Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752239Ab3JDXUN (ORCPT ); Fri, 4 Oct 2013 19:20:13 -0400 Received: from mail-vb0-f45.google.com ([209.85.212.45]:47306 "EHLO mail-vb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244Ab3JDXUL (ORCPT ); Fri, 4 Oct 2013 19:20:11 -0400 MIME-Version: 1.0 In-Reply-To: <87li281wx6.fsf_-_@xmission.com> References: <87a9kkax0j.fsf@xmission.com> <8761v7h2pt.fsf@tw-ebiederman.twitter.com> <87li281wx6.fsf_-_@xmission.com> Date: Fri, 4 Oct 2013 16:20:10 -0700 X-Google-Sender-Auth: HBglA1DIS-4N6SLhGFYV1zHfnPI Message-ID: Subject: Re: [RFC][PATCH 0/3] vfs: Detach mounts on unlink. From: Linus Torvalds To: "Eric W. Biederman" Cc: Miklos Szeredi , "Serge E. Hallyn" , Al Viro , Linux-Fsdevel , Kernel Mailing List , Andy Lutomirski , Rob Landley Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1711 Lines: 38 On Fri, Oct 4, 2013 at 3:41 PM, Eric W. Biederman wrote: > > After thinking about it removing the restrictions on mount points > appears safe, because it is just plain dumb to have a mount point > in a directory that is not restricted to root only modifications. > > This is a change in user visible semantics, so I want to be very careful > about this. Are there any reasons to not make this change? At least one worry: people are very used to 'rmdir()' not removing empty directories, and I've written code myself that just does an 'rmdir()' without worrying about it. I think git has code like "remove file, then try to remove directory file is in, and recurse until it fails or you hit the top of tree". And it all depends on knowing that rmdir() is harmless, and returns the appropriate error when the directory isn't empty. And you're now changing that. If it's a mount-point, the rmdir just succeeds, afaik. Does anybody care? I dunno. But it looks like a _big_ semantic change. That said, I like the _concept_ of being able to remove a mount-point and the mount just goes away. But I do think that for sanity sake, it should have something like "if one of the mounts is in the current namespace, return -EBUSY". IOW, the patch-series would make the VFS layer _able_ to remove mount-points, but a normal rmdir() when something is mounted in that namespace would fail in order to give legacy behavior. Hmm? Linus -- 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/