From: Al Viro <viro@ZenIV.linux.org.uk>
To: Quentin Glidic <sardemff7+linux@sardemff7.net>
Cc: linux-fsdevel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: inotify/sysfs
Date: Mon, 31 Mar 2014 19:52:02 +0100 [thread overview]
Message-ID: <20140331185202.GP18016@ZenIV.linux.org.uk> (raw)
In-Reply-To: <53342CA0.905@sardemff7.net>
On Thu, Mar 27, 2014 at 02:50:24PM +0100, Quentin Glidic wrote:
> Hello,
>
> In GIO (GLib), the GFileMonitor[1] mechanism is using inotify for
> local files. To detect file creation and some other weird cases,
> they monitor the directory of the file and not the file directly
> (see get_basename/get_dirname[2] usage).
>
> With sysfs, it does not work as expected for some reason.
>
> From a quick discussion of IRC with GLib folks, it appears that it
> would be better fixed in sysfs directly.
inotify does not and will not work on sysfs. Or procfs. Or devpts. Or
any number of network filesystems. No matter how hard somebody might wish
it to work, that's simply not feasible.
Linus, what do you think about flat-out refusing to create the watches on
filesystems that can't support them? At inotify_add_watch(2)/fanotify_mark(2)
time. Do you think that it would break syscall ABI warranties? As it is,
the caller has no way to tell it needs to go for a fallback, short of
getting ENOSYS on inotify_init(). And it *does* need to have fallback,
simply because there's no way in hell to get notifications for a lot of
places in synthetic filesystems, etc.
If userland developers pull that kind of stunts (see above re GLib crowd
trying to defend their garbage by suggesting that kernel must somehow
make *notify work on all filesystems), we'd better push back before that
behaviour spreads.
BTW, inotify(7) and inotify_add_watch(2) need to be fixed - they do not
mention these limitations at all. Assuming that reader has a clue and
realizes that there's no magic is not a good idea...
next prev parent reply other threads:[~2014-03-31 18:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 13:50 inotify/sysfs Quentin Glidic
2014-03-28 17:07 ` inotify/sysfs Jan Kara
2014-03-29 6:25 ` inotify/sysfs Greg KH
2014-03-31 18:52 ` Al Viro [this message]
2014-03-31 19:13 ` inotify/sysfs Linus Torvalds
2014-03-31 20:00 ` inotify/sysfs Al Viro
2014-03-31 20:10 ` inotify/sysfs Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140331185202.GP18016@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=sardemff7+linux@sardemff7.net \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.