From: Tvrtko Ursulin <tvrtko.ursulin@sophos.com>
To: Eric Paris <eparis@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Polling(2) /proc/mounts is broken?
Date: Mon, 13 Dec 2010 12:26:18 +0000 [thread overview]
Message-ID: <201012131226.19265.tvrtko.ursulin@sophos.com> (raw)
In-Reply-To: <d8aa5094-8042-4172-8e1d-7d2c7f2299a7@us-col-exch1.green.sophos>
On Friday 10 Dec 2010 15:32:48 Tvrtko Ursulin wrote:
> Hi all,
>
> So since we cannot get fanotify global mode we were told to poll(2) on
> /proc/mounts and set up new mount marks dynamically.
>
> Is the attached C program roughly how it should work?
>
> Because on 2.6.37-rc5 it busy loops for me (POLLIN always reported), even
> though if I remove the seek it gets EOF immediately after POLLIN.
>
> Under 2.6.32 (Ubuntu flavour) I see the same behaviour.
>
> Going further back to 2.6.24 (again Ubuntu flavour) and there it works, but
> it set POLLERR instead of POLLIN in revents.
>
> So I guess it regressed somewhere in between. I'll look to provide a fix
> unless someone more familiar with this area beats me to it.
It hasn't regressed but was fixed in 2.6.30. :)
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31b07093c44a7a442394d44423e21d783f5523b8
So it is incorrect to poll for POLLIN. In case of /proc/mounts POLLPRI should
be used and will be returned together with POLLERR.
Tvrtko
Sophos Limited, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 991 2418 08.
prev parent reply other threads:[~2010-12-13 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-10 15:32 Tvrtko Ursulin
2010-12-13 12:26 ` Tvrtko Ursulin [this message]
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=201012131226.19265.tvrtko.ursulin@sophos.com \
--to=tvrtko.ursulin@sophos.com \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®