From owner-freebsd-stable@freebsd.org Sat Feb 27 13:00:38 2021 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B3D6566687 for ; Sat, 27 Feb 2021 13:00:38 +0000 (UTC) (envelope-from ardovm@yahoo.it) Received: from sonic310-57.consmr.mail.ir2.yahoo.com (sonic310-57.consmr.mail.ir2.yahoo.com [77.238.177.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dnmps17dKz4qVN for ; Sat, 27 Feb 2021 13:00:36 +0000 (UTC) (envelope-from ardovm@yahoo.it) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1614430834; bh=RH1CfOnq6CuKbRiMHnZaYiIh6/uwYjmObVBWwjKqO7D=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=mENrcEYomE7iJHWmdzX99xv0KV3w/Ju/D+e7eC28twNA8AuHasnqGdFuxCc1IVpbfS815aGVBFOcrYOIvu73GjAybdiUQEQprOqg10qAX67EfYuVfFtQ5thLhZwpz4K14rEd4IGH9UhXib/UXW5z+7xAakB14IjjSm22rgGFuEjxUhQFDI0VEOj7uVi8iocMwo2KsJKtgKQHwrFVq/f24ZwoFr+5uSXuhq9RZCG+dTNqOBhWSjKskSgsiTB9C50OToh5GK8kC8CSCUR2C+iU27ia2ESsUsEgWa5WfyFriOgejauTnJ2Kn5YeX27TbyTnW90TBEMkQzWkMx8Waevwpw== X-YMail-OSG: wEAeHhAVM1mj7udNBxPeLdvcq2uVoY4sxgwocPpeqDTysZJAgo0YPL_P1TlMpZT IalNxUT0HtX8IAbHJQ_5EpZ1cvEfAd4hefbRF.U73NLr1vIU9cguwyE2d4H5l3MxRwhKwruJ6i1a 4h9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yh0ugRdEwVEZIVppi9fRHoZvW0pOK6baRYVhKVrUa_sCM29AxkihjYboAmMm yladi7GzzW6Bs0JUEDI3rM6N6C07KzKsvxE4WPG3GQy3.eUR.YzfQop4IFK6zLthmObtHozb5LxC A3ZwYhvi4cILOqUSNXI3SUNVNdYauAxlzDFHq_PGHf_hCfyQIrH08T3ej0_jnaULwBCVfVkjxYJH BkX0Yhvzw0lN0EvGA5XIrsquG40zmijs- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ir2.yahoo.com with HTTP; Sat, 27 Feb 2021 13:00:34 +0000 Received: by smtp410.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 63fb02245e7c928525a8ac7456af5ea6; Sat, 27 Feb 2021 13:00:27 +0000 (UTC) Received: by nuvolo.localdomain (Postfix, from userid 1001) id D787F126815; Sat, 27 Feb 2021 14:00:24 +0100 (CET) Date: Sat, 27 Feb 2021 14:00:24 +0100 From: Arrigo Marchiori To: freebsd-stable@freebsd.org Subject: Re: Trying do mount a slice containing a mounted partition makes the filesystem unreadable Message-ID: References: <202102270821.11R8LerL005602@nuc.oldach.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202102270821.11R8LerL005602@nuc.oldach.net> X-Mailer: WebService/1.1.17828 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.9.1) X-Rspamd-Queue-Id: 4Dnmps17dKz4qVN X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.it]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[yahoo.it:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.it,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.it]; ASN(0.00)[asn:34010, ipnet:77.238.176.0/22, country:GB]; RBL_DBL_DONT_QUERY_IPS(0.00)[77.238.177.30:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yahoo.it:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[77.238.177.30:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[77.238.177.30:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[77.238.177.30:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2021 13:00:38 -0000 Hello Helge, Kevin, and thank you for replying. On Sat, Feb 27, 2021 at 09:21:39AM +0100, Helge Oldach wrote: > Kevin P. Neal wrote on Sat, 27 Feb 2021 03:04:35 +0100 (CET): > > On Fri, Feb 26, 2021 at 06:25:05PM +0100, Helge Oldach wrote: > > > Arrigo Marchiori via freebsd-stable wrote on Fri, 26 Feb 2021 17:02:35 +0100 (CET): > > > > Description: when a BSD partition is mounted to / (suppose > > > > /dev/da0s2a), if I try to mount its containing slice (/dev/da0s2) I > > > > receive a ``strange'' error message, and from that moment the mounted > > > > filesystem becomes unreadable. > > > > > > Actually you are mounting the same location on disk twice under > > > different file systems which is a bad idea. > > > > > > For example: > > > > > > # gpart show -p ada0s2 > > > => 0 250064341 ada0s2 BSD (119G) > > > 0 241172480 ada0s2a freebsd-ufs (115G) > > > 241172480 8891861 ada0s2b freebsd-swap (4.2G) > > > > > > Note the "0" offset for both ada0s2 and ada0s2a. When you mount, both > > > "look" like a proper, distinct UFS but actually it's the same location > > > on disk so UFS will get confused if you have both mounted rw. It should > > > go well however if only one is mounted rw and the other(s) ro. I believe that the memstick images may not organized as you pointed out. The standard behavior of mkimg(1) is to leave a small gap between the beginning of the slice and the beginning of the first partition. But I will be able to confirm on Monday, when I will be back to the office. > > Wait, really? It seems like the ro mount wouldn't see any blocks (or other > > unit of data) cached by the rw mount. So the ro mount would see an > > inconsistent filesystem and I personally would expect a crash or other > > misbehavior. > > Of course the ro "view" will show inconistencies. That's actually what > one asks for if doing such bad things as mounting volumes twice. However > it shouldn't crash as the rw mount of / maintains consistency. On the memstick, the root filesystem is mounted read-only. I apologize, I should have told it explicitly. The ``invalid'' attempt is to mount it read-write (no mode is indicated on the command line). I did not try the mount command in read-only mode. I can try this on Monday as well. IMHO it is important to note that everything works as expected when the partition is mounted from /dev/ufs/label: the mount attempt is not permitted and nothing else happens. Even if mounting an already-mounted partition is an invalid action, I do not think that it should render a system unstable. I understand that ``the root user should be allowed to do anything'', even shoot themselves in the foot. But on the other hand, there are features such as kern.geom.debugflags that explicitly avoid it. I hope I could explain myself clearly. Best regards, -- Arrigo http://rigo.altervista.org