]> Git Repo - linux.git/commitdiff
Merge tag 'fsnotify_for_v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Mon, 6 Apr 2020 15:58:42 +0000 (08:58 -0700)
committerLinus Torvalds <[email protected]>
Mon, 6 Apr 2020 15:58:42 +0000 (08:58 -0700)
Pull fsnotify updates from Jan Kara:
 "This implements the fanotify FAN_DIR_MODIFY event.

  This event reports the name in a directory under which a change
  happened and together with the directory filehandle and fstatat()
  allows reliable and efficient implementation of directory
  synchronization"

* tag 'fsnotify_for_v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  fanotify: Fix the checks in fanotify_fsid_equal
  fanotify: report name info for FAN_DIR_MODIFY event
  fanotify: record name info for FAN_DIR_MODIFY event
  fanotify: Drop fanotify_event_has_fid()
  fanotify: prepare to report both parent and child fid's
  fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name
  fanotify: divorce fanotify_path_event and fanotify_fid_event
  fanotify: Store fanotify handles differently
  fanotify: Simplify create_fd()
  fanotify: fix merging marks masks with FAN_ONDIR
  fanotify: merge duplicate events on parent and child
  fsnotify: replace inode pointer with an object id
  fsnotify: simplify arguments passing to fsnotify_parent()
  fsnotify: use helpers to access data by data_type
  fsnotify: funnel all dirent events through fsnotify_name()
  fsnotify: factor helpers fsnotify_dentry() and fsnotify_file()
  fsnotify: tidy up FS_ and FAN_ constants

1  2 
kernel/audit_watch.c

diff --combined kernel/audit_watch.c
index 8a8fd732ff6d09fd6ae19f344cbe5848e40ec446,dcfbb44c67201c5984ce4e51cc0fafe0a57eb20f..e09c551ae52d49f4f78460d8e84d47e420a9cc3d
@@@ -301,6 -301,8 +301,6 @@@ static void audit_update_watch(struct a
                        }
                        if (oentry->rule.exe)
                                audit_remove_mark(oentry->rule.exe);
 -
 -                      audit_watch_log_rule_change(r, owatch, "updated_rules");
  
                        call_rcu(&oentry->rcu, audit_free_rule_rcu);
                }
@@@ -471,25 -473,13 +471,13 @@@ static int audit_watch_handle_event(str
                                    struct fsnotify_iter_info *iter_info)
  {
        struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info);
-       const struct inode *inode;
+       const struct inode *inode = fsnotify_data_inode(data, data_type);
        struct audit_parent *parent;
  
        parent = container_of(inode_mark, struct audit_parent, mark);
  
        BUG_ON(group != audit_watch_group);
-       switch (data_type) {
-       case (FSNOTIFY_EVENT_PATH):
-               inode = d_backing_inode(((const struct path *)data)->dentry);
-               break;
-       case (FSNOTIFY_EVENT_INODE):
-               inode = (const struct inode *)data;
-               break;
-       default:
-               BUG();
-               inode = NULL;
-               break;
-       }
+       WARN_ON(!inode);
  
        if (mask & (FS_CREATE|FS_MOVED_TO) && inode)
                audit_update_watch(parent, dname, inode->i_sb->s_dev, inode->i_ino, 0);
This page took 0.086234 seconds and 4 git commands to generate.