Re: [PATCH v3 1/3] splice: always fsnotify_access(in), fsnotify_modify(out) on success

From: Ahelenia Ziemiańska
Date: Tue Jun 27 2023 - 16:14:01 EST


On Tue, Jun 27, 2023 at 09:10:09PM +0300, Amir Goldstein wrote:
> On Tue, Jun 27, 2023 at 7:55 PM Ahelenia Ziemiańska
> <nabijaczleweli@xxxxxxxxxxxxxxxxxx> wrote:
> > @@ -1209,18 +1204,20 @@ long do_splice(struct file *in, loff_t *off_in, struct file *out,
> >
> > ret = splice_file_to_pipe(in, opipe, &offset, len, flags);
> >
> > - if (ret > 0)
> > - fsnotify_access(in);
> > -
> > if (!off_in)
> > in->f_pos = offset;
> > else
> > *off_in = offset;
> > + } else
> > + return -EINVAL;
> >
> > - return ret;
> > - }
> > + if (ret > 0)
> > + fsnotify_modify(out);
> > +noaccessout:
> > + if (ret > 0)
> > + fsnotify_access(in);
> >
> As I wrote, I don't like this special case.
> I prefer that we generate double IN_MODIFY than
> having to maintain unreadable code.
>
> Let's see what Jan has to say about this.
Yes, in principle I definitely agree, but I don't know what the official
policy is on (effectively-)spurious/duplicate events; neither the kernel
documentation nor the manual speak to the reliability of the signal,
so I defaulted to the variant I thought to be correcter, if filthy.

Attachment: signature.asc
Description: PGP signature