Thread (59 messages) read the whole thread 59 messages, 4 authors, 2021-10-28
STALE1738d

Revision v8 of 3 in this series.

Revisions (3)
  1. v7 [diff vs current]
  2. v8 current
  3. v9 [diff vs current]

[PATCH v8 11/32] fsnotify: Protect fsnotify_handle_inode_event from no-inode events

From: Gabriel Krisman Bertazi <hidden>
Date: 2021-10-19 00:01:49
Also in: linux-ext4, linux-fsdevel
Subsystem: filesystems (vfs and infrastructure), fsnotify: filesystem notification infrastructure, the rest · Maintainers: Alexander Viro, Christian Brauner, Jan Kara, Linus Torvalds

FAN_FS_ERROR allows events without inodes - i.e. for file system-wide
errors.  Even though fsnotify_handle_inode_event is not currently used
by fanotify, this patch protects this path to handle this new case.

Suggested-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Gabriel Krisman Bertazi <redacted>
---
 fs/notify/fsnotify.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index fde3a1115a17..47f931fb571c 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -252,6 +252,9 @@ static int fsnotify_handle_inode_event(struct fsnotify_group *group,
 	if (WARN_ON_ONCE(!ops->handle_inode_event))
 		return 0;
 
+	if (!inode)
+		return 0;
+
 	if ((inode_mark->mask & FS_EXCL_UNLINK) &&
 	    path && d_unlinked(path->dentry))
 		return 0;
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help