Thread (46 messages) 46 messages, 4 authors, 2021-10-27

Re: [PATCH v9 24/31] fanotify: Report fid entry even for zero-length file_handle

From: Jan Kara <jack@suse.cz>
Date: 2021-10-26 12:06:46
Also in: linux-api, linux-fsdevel

On Tue 26-10-21 12:09:19, Amir Goldstein wrote:
On Mon, Oct 25, 2021 at 10:30 PM Gabriel Krisman Bertazi
[off-list ref] wrote:
quoted
Non-inode errors will reported with an empty file_handle.  In
preparation for that, allow some events to print the FID record even if
there isn't any file_handle encoded

Even though FILEID_ROOT is used internally, make zero-length file
handles be reported as FILEID_INVALID.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Gabriel Krisman Bertazi <redacted>

---
Changes since v8:
  - Move fanotify_event_has_object_fh check here (jan)
Logically, this move is wrong, because after this patch,
copy_fid_info_to_user() can theoretically be called with NULL fh in the
existing construct of:
  if (fanotify_event_has_object_fh(event)) {
  ...
    ret = copy_fid_info_to_user(fanotify_event_fsid(event),

fanotify_event_object_fh(event),

The thing that prevents this case in effect is that FAN_FS_ERROR
is not yet wired, but I am not sure if leaving this theoretic bisect
issue is a good idea.

Anyway, that's a very minor theoretic issue and I am sure Jan can
decide whether to deal with it and how (no need to post v10 IMO).
Hum, correct. I guess I'll just fold this patch into patch 26. Logically
they are very close anyway.

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help