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

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

 



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


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

  Powered by Linux