All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Matthew Bobrowski <mbobrowski@mbobrowski.org>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/7] fsnotify: pass dentry instead of inode data for move events
Date: Fri, 29 Oct 2021 14:40:22 +0300	[thread overview]
Message-ID: <20211029114028.569755-2-amir73il@gmail.com> (raw)
In-Reply-To: <20211029114028.569755-1-amir73il@gmail.com>

This is needed for reporting the new parent/name with MOVED_FROM
events.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 include/linux/fsnotify.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 787545e87eeb..ae7501c80d05 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -140,7 +140,6 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
 				 int isdir, struct inode *target,
 				 struct dentry *moved)
 {
-	struct inode *source = moved->d_inode;
 	u32 fs_cookie = fsnotify_get_cookie();
 	__u32 old_dir_mask = FS_MOVED_FROM;
 	__u32 new_dir_mask = FS_MOVED_TO;
@@ -154,14 +153,14 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
 		new_dir_mask |= FS_ISDIR;
 	}
 
-	fsnotify_name(old_dir_mask, source, FSNOTIFY_EVENT_INODE,
+	fsnotify_name(old_dir_mask, moved, FSNOTIFY_EVENT_DENTRY,
 		      old_dir, old_name, fs_cookie);
-	fsnotify_name(new_dir_mask, source, FSNOTIFY_EVENT_INODE,
+	fsnotify_name(new_dir_mask, moved, FSNOTIFY_EVENT_DENTRY,
 		      new_dir, new_name, fs_cookie);
 
 	if (target)
 		fsnotify_link_count(target);
-	fsnotify_inode(source, FS_MOVE_SELF);
+	fsnotify_inode(d_inode(moved), FS_MOVE_SELF);
 	audit_inode_child(new_dir, moved, AUDIT_TYPE_CHILD_CREATE);
 }
 
-- 
2.33.1


  reply	other threads:[~2021-10-29 11:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 11:40 [PATCH 0/7] Report more information in fanotify dirent events Amir Goldstein
2021-10-29 11:40 ` Amir Goldstein [this message]
2021-10-29 11:40 ` [PATCH 2/7] fanotify: introduce group flag FAN_REPORT_TARGET_FID Amir Goldstein
2021-10-29 11:40 ` [PATCH 3/7] fanotify: use macros to get the offset to fanotify_info buffer Amir Goldstein
2021-10-29 11:40 ` [PATCH 4/7] fanotify: support secondary dir fh and name in fanotify_info Amir Goldstein
2021-10-29 11:40 ` [PATCH 5/7] fanotify: record new parent and name in MOVED_FROM event Amir Goldstein
2021-11-12 16:48   ` Jan Kara
2021-11-13  9:40     ` Amir Goldstein
2021-11-15  8:18       ` Jan Kara
2021-10-29 11:40 ` [PATCH 6/7] fanotify: report " Amir Goldstein
2021-10-29 11:40 ` [PATCH 7/7] fanotify: enable the FAN_REPORT_TARGET_FID flag Amir Goldstein
2021-11-06 16:29 ` [PATCH 0/7] Report more information in fanotify dirent events Amir Goldstein
2021-11-12 16:39   ` Jan Kara
2021-11-13  9:49     ` Amir Goldstein
2021-11-13 19:31       ` Amir Goldstein
2021-11-15 10:23         ` Jan Kara
2021-11-15 12:22           ` Amir Goldstein
2021-11-15 14:37             ` Jan Kara
2021-11-16  6:59               ` Amir Goldstein
2021-11-16 10:12                 ` Jan Kara
2021-11-18 12:47                   ` Amir Goldstein
2021-11-18 16:29                     ` Jan Kara
2021-11-18 16:43                       ` Amir Goldstein

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=20211029114028.569755-2-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mbobrowski@mbobrowski.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.