linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ahelenia Ziemiańska" <nabijaczleweli@nabijaczleweli.xyz>
To: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Amir Goldstein <amir73il@gmail.com>,
	Chung-Chiang Cheng <cccheng@synology.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v5 0/3] fanotify accounting for fs/splice.c
Date: Mon, 3 Jul 2023 16:42:05 +0200	[thread overview]
Message-ID: <cover.1688393619.git.nabijaczleweli@nabijaczleweli.xyz> (raw)

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]

Previously: https://lore.kernel.org/linux-fsdevel/jbyihkyk5dtaohdwjyivambb2gffyjs3dodpofafnkkunxq7bu@jngkdxx65pux/t/#u

In short:
  * most read/write APIs generate ACCESS/MODIFY for the read/written file(s)
  * except the [vm]splice/tee family
    (actually, since 6.4, splice itself /does/ generate events but only
     for the non-pipes being spliced from/to; this commit is Fixes:ed)
  * userspace that registers (i|fa)notify on pipes usually relies on it
    actually working (coreutils tail -f is the primo example)
  * it's sub-optimal when someone with a magic syscall can fill up a
    pipe simultaneously ensuring it will never get serviced

Thus: actually generate ACCESS/MODIFY for all the
[vm]spliced/teed-from/to files.

LTP tests are staged in
  https://git.sr.ht/~nabijaczleweli/ltp/commit/v4
("inotify13: new test for fs/splice.c functions vs pipes vs inotify"),
validating that one A and/or one M event per [vm]splice(), tee(),
and sendfile() is generated ‒
without this patchset, this only holds for sendfile().

Amir has identified a potential performance impact caused by
correctly generating events, and has prepared patches at
  https://github.com/amir73il/linux/commits/fsnotify_pipe
that optimise the most common cases more aggressively.

Please review, and please consider taking these through the vfs
tree for 6.6.

Thanks,
Ahelenia Ziemiańska (3):
  splice: always fsnotify_access(in), fsnotify_modify(out) on success
  splice: fsnotify_access(fd)/fsnotify_modify(fd) in vmsplice
  splice: fsnotify_access(in), fsnotify_modify(out) on success in tee

 fs/splice.c | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

-- 
2.39.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2023-07-03 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 14:42 Ahelenia Ziemiańska [this message]
2023-07-03 14:42 ` [PATCH v5 1/3] splice: always fsnotify_access(in), fsnotify_modify(out) on success Ahelenia Ziemiańska
2023-07-03 15:02   ` Amir Goldstein
2023-07-03 14:42 ` [PATCH v5 2/3] splice: fsnotify_access(fd)/fsnotify_modify(fd) in vmsplice Ahelenia Ziemiańska
2023-07-03 14:42 ` [PATCH v5 3/3] splice: fsnotify_access(in), fsnotify_modify(out) on success in tee Ahelenia Ziemiańska
2023-07-03 15:44 ` [PATCH v5 0/3] fanotify accounting for fs/splice.c Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1688393619.git.nabijaczleweli@nabijaczleweli.xyz \
    --to=nabijaczleweli@nabijaczleweli.xyz \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cccheng@synology.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).