Date: Mon, 2 Sep 2024 20:29:22 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Jamie Landeg-Jones <jamie@catflap.org> Cc: freebsd-stable@freebsd.org Subject: Re: mount -u removes "noatime" Message-ID: <ZtX18qSceQMgQu3o@kib.kiev.ua> In-Reply-To: <202409020139.4821dOrY070960@donotpassgo.dyslexicfish.net> References: <202409020139.4821dOrY070960@donotpassgo.dyslexicfish.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <path> <fs> > > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZtX18qSceQMgQu3o>