From: "John McCutchan" <john@johnmccutchan.com>
To: "Evgeniy Polyakov" <zbr@ioremap.net>
Cc: mtk.manpages@gmail.com, "Christoph Hellwig" <hch@lst.de>,
"Robert Love" <rlove@rlove.org>,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [take 3] Use pid in inotify events.
Date: Thu, 20 Nov 2008 14:34:11 -0800 [thread overview]
Message-ID: <cfec22b10811201434v2230d11dvc9797018e433fd20@mail.gmail.com> (raw)
In-Reply-To: <20081119145351.GA2652@ioremap.net>
On Wed, Nov 19, 2008 at 6:53 AM, Evgeniy Polyakov <zbr@ioremap.net> wrote:
> Hi Michael.
>
> On Wed, Nov 19, 2008 at 09:34:46AM -0500, Michael Kerrisk (mtk.manpages@googlemail.com) wrote:
>> > So effectively you propose to have second generation of the inotify
>> > which will have additional pid field, which will be unused by all but
>> > the same uid events?
>>
>> I susepect that Christoph wants the same thing as I do: some thinking
>> towards a future-proof design, rather than a quick hack to address the needs
>> of a single application.
>
> So far the only real need is a pid. That will solve the cases I'm
> working on and it may be interesting for other applications. It is
> possible to extend read/write IO with offset and size parameters though.
>
> Do you see any other possible extensions?
>
>> > If you want to return -EPERM, than it will be _always_ returned for non
>> > sysadmin capable user, which effectively makes it unusable.
>> >
>> Again, appropriate flags in inotify_init1() could fix this -- e.g., only
>> fill the field (and give an error if no perms) if a flag is set.
>
> Um, hmm... Permission is _always_ denied for 'alien' IO, as it was
> pointed by Robert, at init time there is no way to know, will there be
> alien IO (i.e. originated by the process with different uid) or not.
> More on this: inotify initialization is just a memory allocation in
> the kernel, nothing more.
>
> We can argue about object insertion into inotify queue though. But
> again, we check already that it has read permissions, and if so, we are
> allowed to receive notificatons about IO against given target, since if
> new code will return for whatever reason -EPERM, people will use old
> code.
>
> So, putting PID/whatever else into event can be flag-driven, but there
> is no way to return EPERM anywhere in the call chain not breaking
> backward compatibility of the whole idea.
I really don't like the idea of overloading the cookie field to store
the pid for only the events that don't already use the cookie field.
Coming into this late, maybe I missed it but can you explain why you
need the pid that caused the event?
--
John McCutchan <john@johnmccutchan.com>
next prev parent reply other threads:[~2008-11-20 22:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <acdcfe7e0811081035l56eedf05x8b3b7ee2fc01eee6@mail.gmail.com>
2008-11-08 18:40 ` [1/1] " Evgeniy Polyakov
2008-11-08 22:03 ` Evgeniy Polyakov
2008-11-10 15:13 ` [take 2] " Evgeniy Polyakov
2008-11-16 23:24 ` [take 3] " Evgeniy Polyakov
2008-11-17 16:59 ` Michael Kerrisk
2008-11-17 17:15 ` Evgeniy Polyakov
2008-11-17 17:23 ` Michael Kerrisk
2008-11-17 17:52 ` Evgeniy Polyakov
2008-11-20 13:09 ` Pavel Machek
2008-11-21 14:03 ` Evgeniy Polyakov
2008-11-21 14:20 ` Michael Kerrisk
2008-11-21 14:37 ` Evgeniy Polyakov
2008-11-21 14:30 ` Robert Love
2008-11-21 14:53 ` Evgeniy Polyakov
2008-11-21 14:57 ` Pavel Machek
2008-11-21 15:08 ` Evgeniy Polyakov
2008-11-18 13:19 ` Christoph Hellwig
2008-11-19 14:05 ` Evgeniy Polyakov
[not found] ` <cfd18e0f0811190634g276b4a2dm5b3d5de25a5c9222@mail.gmail.com>
2008-11-19 14:43 ` Michael Kerrisk
2008-11-20 19:17 ` Ville Syrjälä
2008-11-19 14:53 ` Evgeniy Polyakov
2008-11-20 22:34 ` John McCutchan [this message]
2008-11-20 23:06 ` Evgeniy Polyakov
2008-11-21 18:39 ` Arnd Bergmann
2008-11-22 7:12 ` David Newall
2008-11-22 9:41 ` Evgeniy Polyakov
2008-11-22 11:41 ` David Newall
2008-11-22 9:37 ` Evgeniy Polyakov
2008-11-24 5:08 ` John McCutchan
2008-11-24 7:30 ` Evgeniy Polyakov
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=cfec22b10811201434v2230d11dvc9797018e433fd20@mail.gmail.com \
--to=john@johnmccutchan.com \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=rlove@rlove.org \
--cc=zbr@ioremap.net \
/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®