LWN: Comments on "watch_mount(), watch_sb(), and fsinfo() (again)" https://lwn.net/Articles/813172/ This is a special feed containing comments posted to the individual LWN article titled "watch_mount(), watch_sb(), and fsinfo() (again)". en-us Thu, 16 Oct 2025 09:56:54 +0000 Thu, 16 Oct 2025 09:56:54 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813494/ https://lwn.net/Articles/813494/ dhowells <div class="FormattedComment"> I'm trying to make a generic notification system, with such properties as:<br> - messages can be longer than 8 bytes (say up to 128 bytes);<br> - message queueing requires no on-the-spot allocation and can be done from softirq/irq context or inside spinlocks;<br> - messages can come from a variety of sources (e.g. mount(2), add_key(2), keyctl(2), sb errors, usb notifications, ...);<br> - messages from different sources can be in the same queue;<br> - messages may need copying into multiple queues;<br> - filters can be easily employed;<br> - message loss reporting.<br> <p> As has been mentioned, there are existing solutions:<br> - Netlink:<br> - would make the core VFS dependent on the networking code.<br> - would require GFP_ATOMIC message allocation at the point of generation (at least sometimes).<br> - doesn't seem to make it easy to do message loss reporting.<br> - epoll is for dealing with file descriptors - but we're not dealing with fd events.<br> - Not all sources I need notifications for can be addressed with fanotify.<br> - eventfd() has 8-byte messages.<br> <p> Pipes have disadvantages too: no message loss reporting (I'm having to add it); pipe ring buffer metadata elements generally larger than common messages (might be able to optimise in future to store small data in the ring). Note that I didn't want to use pipes either: I was originally using a mappable chardev ring buffer but Linus said I had to use pipes instead.<br> </div> Fri, 28 Feb 2020 14:43:54 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813493/ https://lwn.net/Articles/813493/ dhowells <div class="FormattedComment"> eventfd is limited to 8-byte messages. That is not sufficient.<br> </div> Fri, 28 Feb 2020 14:15:44 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813432/ https://lwn.net/Articles/813432/ kugel <div class="FormattedComment"> There is also eventfd(2)<br> <p> A pipe seems really awkward for one-way event notifications.<br> </div> Thu, 27 Feb 2020 14:47:39 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813317/ https://lwn.net/Articles/813317/ Paf <div class="FormattedComment"> This doesn’t really seem like a big deal - novel and different mechanisms are a problem when they’re, well, novel and different. This is just a pipe, and unless I’ve missed something, it’s not requiring implementing anything.<br> <p> I mean maybe netlink would be superior, but this seems nicely trivial. It’s not like they’re knocking up a netlink competitor, just using a trivial interface where they can.<br> </div> Wed, 26 Feb 2020 14:25:01 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813283/ https://lwn.net/Articles/813283/ maxfragg <div class="FormattedComment"> not sure if the fact that this existed so long without a lot of people noticing makes it better or worse.<br> But I have to agree, having one encouraged interface (probably netlink, or maybe even epoll here?) to be used for any new interface of this type would be a good idea<br> </div> Wed, 26 Feb 2020 07:24:36 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813276/ https://lwn.net/Articles/813276/ cyphar Indeed, that was the entire point of copy_struct_from_user() -- so that new syscalls can be extensible and avoid the need to predict how many future fields you might want (<a href="https://www.youtube.com/watch?v=ggD-eb3yPVs">I gave a talk about this at LCA this year</a>). I've sent a suggestion to the ML, though there is some discussion on the latest thread to remove the need for fsinfo(2) entirely. Wed, 26 Feb 2020 02:19:49 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813264/ https://lwn.net/Articles/813264/ neilbrown <div class="FormattedComment"> This *is* an existing mechanism. autofs has been using a pipe for notification for decades.<br> <p> </div> Tue, 25 Feb 2020 22:36:23 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813203/ https://lwn.net/Articles/813203/ alison <div class="FormattedComment"> <font class="QuotedText">&gt;Why not extend fanotify? </font><br> <p> The author of "man fanotify" appears to have the same question:<br> <p> The fanotify API provides notification and interception of filesystem events.<br> Use cases include virus scanning and hierarchical storage management. **Cur‐<br> rently, only a limited set of events is supported.**<br> <p> </div> Tue, 25 Feb 2020 14:38:17 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813195/ https://lwn.net/Articles/813195/ Cyberax <div class="FormattedComment"> Yes, I actually wanted to ask the same. Why not extend fanotify? <br> </div> Tue, 25 Feb 2020 10:11:57 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813189/ https://lwn.net/Articles/813189/ geert <div class="FormattedComment"> And the explicit padding between an odd number of 32-bit fields, and the 64-bit fields.<br> Fortunately the latter is present in the real declaration:<br> <p> __u32 __reserved32[1]; /* Reserved params; all must be 0 */<br> <p> Perhaps that can be traded for an explicit structure length?<br> </div> Tue, 25 Feb 2020 08:00:43 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813188/ https://lwn.net/Articles/813188/ smurf <div class="FormattedComment"> Regardless of whether netlink would be a good way to do it, this is yet another way to get a string of notifications from the kernel. I do wonder why nobody is complaining loudly that this should use, or maybe improve upon, one of the existing mechanisms.<br> </div> Tue, 25 Feb 2020 07:00:19 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813185/ https://lwn.net/Articles/813185/ anguslees <div class="FormattedComment"> Is netlink an acceptable alternative to the proposed notification pipe, or are the required semantics different?<br> </div> Tue, 25 Feb 2020 04:32:07 +0000 watch_mount(), watch_sb(), and fsinfo() (again) https://lwn.net/Articles/813182/ https://lwn.net/Articles/813182/ Cyberax <div class="FormattedComment"> <font class="QuotedText">&gt; struct fsinfo_params {</font><br> <font class="QuotedText">&gt; __u32 at_flags;</font><br> Sigh.<br> <p> You know what's missing here? Yes, it's the explicit structure length. <br> </div> Mon, 24 Feb 2020 23:09:36 +0000