Skip to content

Commit 79cb299

Browse files
amir73iljankara
authored andcommitted
fsnotify: remove check that source dentry is positive
Remove the unneeded check for positive source dentry in fsnotify_move(). fsnotify_move() hook is mostly called from vfs_rename() under lock_rename() and vfs_rename() starts with may_delete() test that verifies positive source dentry. The only other caller of fsnotify_move() - debugfs_rename() also verifies positive source. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 9b93f33 commit 79cb299

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

include/linux/fsnotify.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
150150

151151
if (target)
152152
fsnotify_link_count(target);
153-
154-
if (source)
155-
fsnotify_inode(source, FS_MOVE_SELF);
153+
fsnotify_inode(source, FS_MOVE_SELF);
156154
audit_inode_child(new_dir, moved, AUDIT_TYPE_CHILD_CREATE);
157155
}
158156

0 commit comments

Comments
 (0)