Re: [PATCH v3 0/3+1] fanotify accounting for fs/splice.c

From: Christoph Hellwig
Date: Wed Jun 28 2023 - 03:57:07 EST


Can you please resend this outside this thread? I really cant't see
what's new or old here if you have a reply-to in the old thread.

On Tue, Jun 27, 2023 at 06:55:22PM +0200, Ahelenia Ziemiańska wrote:
> In 1/3 I've applied if/else if/else tree like you said,
> and expounded a bit in the message.
>
> This is less pretty now, however, since it turns out that
> iter_file_splice_write() already marks the out fd as written because it
> writes to it via vfs_iter_write(), and that sent a double notification.

It seems like vfs_iter_write is the wrong level to implement
->splice_write given that the the ->splice_write caller has already
checked f_mode, done the equivalent of rw_verify_area and
should do the fsnotify_modify. I'd suggest to just open code the
relevant parts of vfs_iocb_iter_write in iter_file_splice_write.