From: Jan Kara <jack@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz,
amir73il@gmail.com, brauner@kernel.org
Subject: Re: [PATCH 03/10] fsnotify: generate pre-content permission event on open
Date: Thu, 1 Aug 2024 19:01:25 +0200 [thread overview]
Message-ID: <20240801170125.uimwmtbt4s6y7a5x@quack3> (raw)
In-Reply-To: <c105b804f1f6e14d7536b98fea428211b131473a.1721931241.git.josef@toxicpanda.com>
On Thu 25-07-24 14:19:40, Josef Bacik wrote:
> From: Amir Goldstein <amir73il@gmail.com>
>
> FS_PRE_ACCESS or FS_PRE_MODIFY will be generated on open depending on
> file open mode. The pre-content event will be generated in addition to
> FS_OPEN_PERM, but without sb_writers held and after file was truncated
> in case file was opened with O_CREAT and/or O_TRUNC.
>
> The event will have a range info of (0..0) to provide an opportunity
> to fill entire file content on open.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
...
> @@ -176,10 +180,14 @@ static inline int fsnotify_file_area_perm(struct file *file, int perm_mask,
>
> /*
> * fsnotify_file_perm - permission hook before file access
> + *
> + * Called from read()/write() with perm_mas MAY_READ/MAY_WRITE.
^^^ perm_mask
> + * Called from open() with MAY_OPEN in addition to fsnotify_open_perm(),
> + * but without sb_writers held and after the file was truncated.
This sentence is a bit confusing to me (although I think I understand what
you want to say). How about just:
* Called from open() with MAY_OPEN without sb_writers held and after the
* file was truncated. Note that this is a different event from
* fsnotify_open_perm().
> */
> static inline int fsnotify_file_perm(struct file *file, int perm_mask)
> {
> - return fsnotify_file_area_perm(file, perm_mask, NULL, 0);
> + return fsnotify_file_area_perm(file, perm_mask, &file->f_pos, 0);
> }
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-08-01 17:01 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 18:19 [PATCH 00/10] fanotify: add pre-content hooks Josef Bacik
2024-07-25 18:19 ` [PATCH 01/10] fanotify: don't skip extra event info if no info_mode is set Josef Bacik
2024-08-01 17:59 ` Jan Kara
2024-07-25 18:19 ` [PATCH 02/10] fsnotify: introduce pre-content permission event Josef Bacik
2024-08-01 16:31 ` Jan Kara
2024-08-03 16:52 ` Amir Goldstein
2024-10-25 7:55 ` Amir Goldstein
2024-10-25 13:09 ` Jan Kara
2024-10-25 13:39 ` Amir Goldstein
2024-10-26 6:58 ` Amir Goldstein
2024-10-31 12:47 ` Jan Kara
2024-07-25 18:19 ` [PATCH 03/10] fsnotify: generate pre-content permission event on open Josef Bacik
2024-08-01 17:01 ` Jan Kara [this message]
2024-08-03 16:53 ` Amir Goldstein
2024-07-25 18:19 ` [PATCH 04/10] fanotify: introduce FAN_PRE_ACCESS permission event Josef Bacik
2024-08-01 17:04 ` Jan Kara
2024-07-25 18:19 ` [PATCH 05/10] fanotify: introduce FAN_PRE_MODIFY " Josef Bacik
2024-08-01 17:09 ` Jan Kara
2024-08-03 16:55 ` Amir Goldstein
2024-08-05 11:18 ` Jan Kara
2024-07-25 18:19 ` [PATCH 06/10] fanotify: pass optional file access range in pre-content event Josef Bacik
2024-08-01 17:16 ` Jan Kara
2024-08-03 17:00 ` Amir Goldstein
2024-08-05 11:20 ` Jan Kara
2024-07-25 18:19 ` [PATCH 07/10] fanotify: rename a misnamed constant Josef Bacik
2024-08-01 17:19 ` Jan Kara
2024-08-01 17:23 ` Jan Kara
2024-07-25 18:19 ` [PATCH 08/10] fanotify: report file range info with pre-content events Josef Bacik
2024-08-01 17:38 ` Jan Kara
2024-10-24 10:06 ` Amir Goldstein
2024-10-24 16:35 ` Jan Kara
2024-10-24 16:49 ` Amir Goldstein
2024-10-24 16:56 ` Jan Kara
2024-07-25 18:19 ` [PATCH 09/10] fanotify: allow to set errno in FAN_DENY permission response Josef Bacik
2024-08-01 21:14 ` Jan Kara
2024-08-03 17:06 ` Amir Goldstein
2024-07-25 18:19 ` [PATCH 10/10] fsnotify: generate pre-content permission event on page fault Josef Bacik
2024-07-25 20:19 ` Amir Goldstein
2024-07-29 17:11 ` Josef Bacik
2024-07-29 18:57 ` Amir Goldstein
2024-07-30 12:18 ` Jan Kara
2024-07-30 16:51 ` Josef Bacik
2024-08-01 21:34 ` Jan Kara
2024-08-01 21:40 ` Jan Kara
2024-08-02 16:03 ` Josef Bacik
2024-08-05 12:13 ` Jan Kara
2024-08-07 19:04 ` Josef Bacik
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=20240801170125.uimwmtbt4s6y7a5x@quack3 \
--to=jack@suse.cz \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-fsdevel@vger.kernel.org \
/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