Re: [systemd-devel] Masking mount units

2024-11-21 Thread Andrei Borzenkov
21.11.2024 20:47, Phillip Susi wrote: Andrei Borzenkov writes: commit 142b8142d7bb84f07ac33fc00527a4d48ac8ef9f Author: Tom Yan Date: Wed Jan 9 23:35:24 2019 +0800 mount/generators: do not make unit wanted by its device unit As device units will be reloaded by systemd whenever th

Re: [systemd-devel] Masking mount units

2024-11-21 Thread Phillip Susi
Andrei Borzenkov writes: > commit 142b8142d7bb84f07ac33fc00527a4d48ac8ef9f > Author: Tom Yan > Date: Wed Jan 9 23:35:24 2019 +0800 > > mount/generators: do not make unit wanted by its device unit > > As device units will be reloaded by systemd whenever the > corresponding device genera

Re: [systemd-devel] Masking mount units

2024-11-19 Thread Andrei Borzenkov
On Tue, Nov 19, 2024 at 10:55 PM Phillip Susi wrote: > > Furthermore, it seems that the undesirable auto mounting behavior only > happens with systemd-239 and lower. Newer versions of systemd seem to > have dropped this behavior by not setting the WantedBy=foo.device on the > mount point. I assu

Re: [systemd-devel] Masking mount units

2024-11-19 Thread Lennart Poettering
On Di, 19.11.24 01:45, Nils Kattenbeck (nilskem...@gmail.com) wrote: > On Tue, Nov 19, 2024 at 1:00 AM Lennart Poettering > wrote: > > > > On Do, 14.11.24 14:25, Phillip Susi (ph...@thesusis.net) wrote: > > > > > Lennart Poettering writes: > > > > > > > the BLKFLSBUF ioctl() works fine on block

Re: [systemd-devel] Masking mount units

2024-11-19 Thread Phillip Susi
Lennart Poettering writes: > Huh? Even after? Like, *forever*??? What's the point of that? Is > gparted supposed to break your system for good and render your block > devices unusable? > > I thought it was a partitioner, but I might have gotten that wrong? Just because you move or resize a parti

Re: [systemd-devel] Masking mount units

2024-11-18 Thread Nils Kattenbeck
On Tue, Nov 19, 2024 at 1:00 AM Lennart Poettering wrote: > > On Do, 14.11.24 14:25, Phillip Susi (ph...@thesusis.net) wrote: > > > Lennart Poettering writes: > > > > > the BLKFLSBUF ioctl() works fine on block device fds open for read only. > > > > Oh, I might have to change that to use a read o

Re: [systemd-devel] Masking mount units

2024-11-18 Thread Lennart Poettering
On Do, 14.11.24 14:25, Phillip Susi (ph...@thesusis.net) wrote: > Lennart Poettering writes: > > > the BLKFLSBUF ioctl() works fine on block device fds open for read only. > > Oh, I might have to change that to use a read only open then. > > > I am not following anymore. As *long* *as* *the* lock

Re: [systemd-devel] Masking mount units

2024-11-14 Thread Phillip Susi
Lennart Poettering writes: > the BLKFLSBUF ioctl() works fine on block device fds open for read only. Oh, I might have to change that to use a read only open then. > I am not following anymore. As *long* *as* *the* lock is taken the > auto mounting doesn't happen. Once you release the lock then

Re: [systemd-devel] Masking mount units

2024-11-11 Thread Lennart Poettering
On Mo, 11.11.24 08:34, Phillip Susi (ph...@thesusis.net) wrote: > Lennart Poettering writes: > > >> I'm reading between the lines a bit, but my guess is that libparted > >> always opens the device writable in case you start issuing actual > >> partitioning commands. > > > > That sounds like a bug

Re: [systemd-devel] Masking mount units

2024-11-11 Thread Phillip Susi
Lennart Poettering writes: >> I'm reading between the lines a bit, but my guess is that libparted >> always opens the device writable in case you start issuing actual >> partitioning commands. > > That sounds like a bug though. They should open the device for write > only when they need to make c

Re: [systemd-devel] Masking mount units

2024-11-01 Thread Lennart Poettering
On Do, 31.10.24 12:08, Dan Nicholson (d...@endlessos.org) wrote: > On Thu, Oct 31, 2024 at 10:23 AM Lennart Poettering > wrote: > > > > On Do, 31.10.24 09:03, Phillip Susi (ph...@thesusis.net) wrote: > > > > > Lennart Poettering writes: > > > > > > Yes, but then it reads the disk and auto mounts

Re: [systemd-devel] Masking mount units

2024-10-31 Thread Andrei Borzenkov
31.10.2024 16:03, Phillip Susi wrote: Lennart Poettering writes: Doing the locking on the fd you use for writing makes things a lot easier, because as mentioned udev will automatically retrigger block devices if an inotify event on it is seen that indicates "close-after-write". If you deal wit

Re: [systemd-devel] Masking mount units

2024-10-31 Thread Dan Nicholson
On Thu, Oct 31, 2024 at 10:23 AM Lennart Poettering wrote: > > On Do, 31.10.24 09:03, Phillip Susi (ph...@thesusis.net) wrote: > > > Lennart Poettering writes: > > > > Yes, but then it reads the disk and auto mounts a partition just because > > someone ran parted print. Printing the partition ta

Re: [systemd-devel] Masking mount units

2024-10-31 Thread Lennart Poettering
On Do, 31.10.24 09:03, Phillip Susi (ph...@thesusis.net) wrote: > Lennart Poettering writes: > > > Doing the locking on the fd you use for writing makes things a lot > > easier, because as mentioned udev will automatically retrigger block > > devices if an inotify event on it is seen that indicat

Re: [systemd-devel] Masking mount units

2024-10-31 Thread Phillip Susi
Lennart Poettering writes: > Doing the locking on the fd you use for writing makes things a lot > easier, because as mentioned udev will automatically retrigger block > devices if an inotify event on it is seen that indicates > "close-after-write". If you deal with multiple fds you need to make

Re: [systemd-devel] Masking mount units

2024-10-30 Thread Lennart Poettering
On Di, 29.10.24 08:28, Phillip Susi (ph...@thesusis.net) wrote: > Lennart Poettering writes: > > > It prevents it fully. However, udev installs an inotify watch on all > > relevant block devices, which watches for IN_CLOSE_WRITE events, and > > then triggers the device again. IN_CLOSE_WRITE is th

Re: [systemd-devel] Masking mount units

2024-10-29 Thread Dan Nicholson
On Tue, Oct 29, 2024 at 6:28 AM Phillip Susi wrote: > > So if you want to prevent automounting entirely you have to... open the > disk device read only and take the bsd lock, and hold it until after > closing the write file descriptor? Plus probably a little more time to > give udev a chance to t

Re: [systemd-devel] Masking mount units

2024-10-29 Thread Phillip Susi
Lennart Poettering writes: > It prevents it fully. However, udev installs an inotify watch on all > relevant block devices, which watches for IN_CLOSE_WRITE events, and > then triggers the device again. IN_CLOSE_WRITE is the event that is > generated when an inode is closed after it was open for

Re: [systemd-devel] Masking mount units

2024-10-25 Thread Phillip Susi
Lennart Poettering writes: > systemd is downstream to udev. If udev doesn't process a block device > because of the taken BSD file lock on the main block device, then > systemd (and other downstreams of udev) won't get such notificaitons > either. And thus won't automount. The BSD lock does not

Re: [systemd-devel] Masking mount units

2024-10-25 Thread Lennart Poettering
On Do, 24.10.24 15:43, Phillip Susi (ph...@thesusis.net) wrote: > Lennart Poettering writes: > > > systemd is downstream to udev. If udev doesn't process a block device > > because of the taken BSD file lock on the main block device, then > > systemd (and other downstreams of udev) won't get such

Re: [systemd-devel] Masking mount units

2024-10-24 Thread Lennart Poettering
On Mi, 23.10.24 14:32, Phillip Susi (ph...@thesusis.net) wrote: > A few years ago you mentioned that gparted should not be masking mount > units and should instead take a bsd lock: > > https://lists.freedesktop.org/archives/systemd-devel/2020-January/043924.html > > I brought this issue back up re

[systemd-devel] Masking mount units

2024-10-23 Thread Phillip Susi
A few years ago you mentioned that gparted should not be masking mount units and should instead take a bsd lock: https://lists.freedesktop.org/archives/systemd-devel/2020-January/043924.html I brought this issue back up recently. It seems like taking a bsd lock would allow gparted to make sure t