]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fsnotify: Do not generate events for O_PATH file descriptors
authorJan Kara <jack@suse.cz>
Mon, 17 Jun 2024 16:23:00 +0000 (18:23 +0200)
committerChristian Brauner <brauner@kernel.org>
Tue, 18 Jun 2024 14:25:50 +0000 (16:25 +0200)
commit702eb71fd6501b3566283f8c96d7ccc6ddd662e9
tree9280870ce9c15572196d4a4a7989bbbbc86dd1df
parent2ae4db5647d807efb6a87c09efaa6d1db9c905d7
fsnotify: Do not generate events for O_PATH file descriptors

Currently we will not generate FS_OPEN events for O_PATH file
descriptors but we will generate FS_CLOSE events for them. This is
asymmetry is confusing. Arguably no fsnotify events should be generated
for O_PATH file descriptors as they cannot be used to access or modify
file content, they are just convenient handles to file objects like
paths. So fix the asymmetry by stopping to generate FS_CLOSE for O_PATH
file descriptors.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240617162303.1596-1-jack@suse.cz
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/fsnotify.h