From nobody Mon Sep 2 17:29:22 2024 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyG382Jsgz5Tm5D for ; Mon, 02 Sep 2024 17:29:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyG376BtLz42kg for ; Mon, 2 Sep 2024 17:29:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 482HTNi9068637; Mon, 2 Sep 2024 20:29:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 482HTNi9068637 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 482HTMWN068636; Mon, 2 Sep 2024 20:29:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 2 Sep 2024 20:29:22 +0300 From: Konstantin Belousov To: Jamie Landeg-Jones Cc: freebsd-stable@freebsd.org Subject: Re: mount -u removes "noatime" Message-ID: References: <202409020139.4821dOrY070960@donotpassgo.dyslexicfish.net> List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202409020139.4821dOrY070960@donotpassgo.dyslexicfish.net> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4WyG376BtLz42kg On Mon, Sep 02, 2024 at 02:39:24AM +0100, Jamie Landeg-Jones wrote: > I noticed some of my noatime mounts keep being reset to atime. Looking > further, I found out the culprit was a snapshotting program running: > > mount -u -o snapshot > > It turns out, that just using -u causes noatime to be dropped: > > | root@catflap# mount -v | grep da0p3 > | /dev/da0p3 on / (ufs, local, noatime, writes: sync 3343750 async 2795680, reads: sync 204356 async 10254, fsid 1fa69665dd23d4e8, vnodes: count 3803 ) > > | root@catflap# mount -u / > | /dev/da0p3 on / (ufs, local, writes: sync 3343750 async 2795680, reads: sync 204356 async 10254, fsid 1fa69665dd23d4e8, vnodes: count 3803 ) > > I assume this shouldn't be the case? This is how mount update works. How otherwise would you remove noatime from the options? It seems to be true for other 'flag' options as well. Really nonoatime should work with nmount, but it probably does not. > > Incidentally, is there any difference between "mksnap_ffs" and "mount -u -o snapshot..."? (other that the noatime mangling) > > Finally, man mount(8) has: > > | Note that the schg flag is set on snapshots to ensure that not even the root > | user can write to them. The unlink command makes an exception for snapshot > | files in that it allows them to be removed even though they have the schg > | flag set, so it is not necessary to clear the schg flag before removing a > | snapshot file. > > The schg flag isn't set on snapshots, at least according to ls -lo Indeed, we ensure immutability of snapshots by directly checking the fact that the file accessed for write cannot be snapshot. The paragraph perhaps should be reformulated to state that instead.