On Mon 06-07-20 11:21:24, Amir Goldstein wrote: > On Fri, Jul 3, 2020 at 7:02 PM Jan Kara <jack@xxxxxxx> wrote: > > > > On Fri 12-06-20 12:33:42, Amir Goldstein wrote: > > > An fanotify event name is always recorded relative to a dir fh. > > > Move the name_len members of fanotify_name_event into unused space > > > in struct fanotify_fh. > > > > > > We add a name_offset member to allow packing a binary blob before > > > the name string in the variable size buffer. We are going to use > > > that space to store the child fid. > > > > So how much is this packing going to save us? Currently it is 1 byte for > > name events (modulo that fanotify_alloc_name_event_bug() you mention > > below). With the additional fanotify_fh in the event, we'll save two more > > bytes by the packing. So that doesn't really seem to be worth it to me. > > Am I missing some other benefit? > > > > Maybe your main motivation (which is not mentioned in the changelog at all > > BTW) is that the whole game of inline vs out of line file handles is > > pointless when we kmalloc() the event anyway because of the name? > > The only motivation, which is written in the commit message is to make > space to store the child file handle. Saving space is just a by product. > In fact, the new parceling code looses this space back to alignment > and I am perfectly fine with that. Yeah, I think the loss is acceptable. > I tried your suggestion (with the minor modifications above) and I > like the result. > Pushed prep series with 2 last patches changed to branch fanotify_prep. > Old prep series is at fanotify_prep-v2. Yeah, I like the result as well. I've left some minor comments on github. Please repost the preparatory series once you address the comments so that we have something for final review and picking up into my tree. > Pushed tested full series adapted to this change to fanotify_name_fid. > Old full series is at fanotify_name_fid-v4. > > There was almost no changes to the fanotify_name_fid patches besides > adapting the accessors, e.g.: > - fanotify_fh_blob(&FANOTIFY_NE(event)->dir_fh); > + fanotify_info_file_fh(&FANOTIFY_NE(event)->info); > > Please let me know if you want me to post fanotify_name_fid-v5 with these > changes. No need to repost at this point I guess. I can do a high-level check with what I have... Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR