Re: [PATCH 3/4] fanotify: Track permission event state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 09-01-19 09:22:19, Amir Goldstein wrote:
> > @@ -31,7 +37,9 @@ struct fanotify_event_info {
> >   */
> >  struct fanotify_perm_event_info {
> >         struct fanotify_event_info fae;
> > -       int response;   /* userspace answer to question */
> > +       unsigned int response;  /* userspace answer to the event. We also use
> > +                                * high bits of this field for recording state
> > +                                * of the event. */
> 
> What's wrong with:
> 
>         short response;   /* userspace answer to question */
>         short state;   /* the state of this event */
> 
> Will make for a much simpler code/patch IMO.

I guess you're right. I'm somewhat cautious about types shorter than int as
I do read 'state' locklessly and for shorter-than-int types compiler can do
fancy things like read-modify-write cycle of a full word when storing some
value in either response or state. But I think this particular case should
be fine.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux