On Thu, Aug 1, 2024 at 7:16 PM Jan Kara <jack@xxxxxxx> wrote: > > On Thu 25-07-24 14:19:43, Josef Bacik wrote: > > From: Amir Goldstein <amir73il@xxxxxxxxx> > > > > We would like to add file range information to pre-content events. > > > > Pass a struct file_range with optional offset and length to event handler > > along with pre-content permission event. > > > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > > ... > > > @@ -565,6 +569,10 @@ static struct fanotify_event *fanotify_alloc_perm_event(const struct path *path, > > pevent->hdr.len = 0; > > pevent->state = FAN_EVENT_INIT; > > pevent->path = *path; > > + if (range) { > > + pevent->ppos = range->ppos; > > + pevent->count = range->count; > > + } > > Shouldn't we initialze ppos & count in case range info isn't passed? Currently, range info is always passed in case of fanotify_event_has_access_range(), but for robustness I guess we should. Thanks, Amir.