Re: [PATCH 4/4] fanotify: Expose the file changes to the user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Paris
Date: Monday, November 29, 2010 - 11:14 am

On Mon, 2010-11-29 at 19:51 +0300, Alexey Zaytsev wrote:

[rewriting history!]


So the last discussion is around vers and options_offset.

Alexy:				Tvrtko:
__u8 vers;			__u16 vers;
__u8 options_offset;		__u16 options_offset;
__u16 unused;

The only type of long option that first comes to mind is a filename.   A
filename could easily blow out the __u8 options_offset.  I probably
shouldn't put that in the event_metadata since it wouldn't be fixed
length and it wouldn't allow fixed offset extention of the
event_metadata, so maybe I shouldn't worry about it.  I'm trying to
think of reasons why __u8 isn't adequate other than my usual "just make
it bigger than we ever need"

You'll notice I'm using __u64 for the mask, even though we don't come
close to filling up an __u32 at this point.

Even though I can't think of a likely reason __u8 is bad I think I like
the 'Tvrtko' option better.  I think we should do a compromise:

Eric:
__u8 vers;
__u8 unused;
__u16 options_offset;

If we ever overload vers we can expand into another field.  Would could
change unused into vers2 and define the version as vers + vers2;  vers2
could even exist somewhere else in the metadata.  That can be done once
we get to version 254 while maintaining backwards compat beyond 255.  If
we ever overflow options_offset we are screwed since old userspace
wouldn't know how to handle things.

So, if you want to send me a patch that implements the above (along with
the obvious version bump to 3, I'll queue it up for this merge window
even though we have an ABI compatible solution.

-Eric

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4] Series short description, Alexey Zaytsev, (Sun Nov 21, 5:31 pm)
[PATCH 3/4] fsnotify: Handle the file change ranges, Alexey Zaytsev, (Sun Nov 21, 5:33 pm)
[PATCH 4/4] fanotify: Expose the file changes to the user, Alexey Zaytsev, (Sun Nov 21, 5:37 pm)
Re: [PATCH 4/4] fanotify: Expose the file changes to the user, Eric Paris, (Mon Nov 29, 11:14 am)