From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D4A7C43381 for ; Fri, 15 Feb 2019 10:18:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B18721A80 for ; Fri, 15 Feb 2019 10:18:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387692AbfBOKSH convert rfc822-to-8bit (ORCPT ); Fri, 15 Feb 2019 05:18:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:49476 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726202AbfBOKSH (ORCPT ); Fri, 15 Feb 2019 05:18:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6969BAC5E for ; Fri, 15 Feb 2019 10:18:06 +0000 (UTC) From: =?utf-8?Q?Aur=C3=A9lien?= Aptel To: NeilBrown , linux-fsdevel@vger.kernel.org Subject: Re: Duplicate network filesystems In-Reply-To: <87mumxen2m.fsf@notabene.neil.brown.name> References: <87sgwujjgu.fsf@suse.com> <87mumxen2m.fsf@notabene.neil.brown.name> Date: Fri, 15 Feb 2019 11:18:04 +0100 Message-ID: <87ef89qrs3.fsf@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org NeilBrown writes: >> mount //foo /mnt -o A >> mount //foo /mnt -o B # different options >> >> Since the SB are different it works, fine. >> >> But mounting a 3rd time with options A succeeds, where from a user POV I >> would have expected to fail. > > Why? Because it's already mounted. >> mount //foo /mnt -o A >> mount //foo /mnt -o B >> mount //foo /mnt -o A >> # ok => what? >> >> Shouldn't we check the stack of filesystems mounted at the path instead of >> just the last one? > > Why? > > I think that the main reason that -EBUSY is important is that people > often run "mount -a" and don't expect filesystems that are already > mounted to be mounted again. The current behaviour achieves that. A is already mounted and mouting again succeeds. The current behaviour is different from what you described. This is exactly what I was saying earlier "from a user POV". Side-note: mount from coreutils has some logic to deal with -a and network filesystems, because there are some issues with the default behaviour. I can't recall the details about that, would have to look at the code again. Cheers, -- Aurélien Aptel / SUSE Labs Samba Team GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3 SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)