summaryrefslogtreecommitdiff
path: root/fs/kernfs/file.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-09-26 10:37:43 -0700
committerDmitry Shmidt <dimitrysh@google.com>2016-09-26 10:37:43 -0700
commit734bcf32c23442e81891641ae05e08108a4010d5 (patch)
treeb41cc318506b0c38ddf404520ba67753f3ab5452 /fs/kernfs/file.c
parent551569f25ec07596e144ffbc7911dd631645e63b (diff)
parent8d5e93bb8c9c48ee5948f6b1aff0e895381f09e6 (diff)
Merge tag 'v4.4.22' into android-4.4.y
This is the 4.4.22 stable release Change-Id: Id49e3c87d2cacb2fa85d85a17226f718f4a5ac28
Diffstat (limited to 'fs/kernfs/file.c')
-rw-r--r--fs/kernfs/file.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 7247252ee9b1..6e9a912d394c 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -833,21 +833,35 @@ repeat:
mutex_lock(&kernfs_mutex);
list_for_each_entry(info, &kernfs_root(kn)->supers, node) {
+ struct kernfs_node *parent;
struct inode *inode;
- struct dentry *dentry;
+ /*
+ * We want fsnotify_modify() on @kn but as the
+ * modifications aren't originating from userland don't
+ * have the matching @file available. Look up the inodes
+ * and generate the events manually.
+ */
inode = ilookup(info->sb, kn->ino);
if (!inode)
continue;
- dentry = d_find_any_alias(inode);
- if (dentry) {
- fsnotify_parent(NULL, dentry, FS_MODIFY);
- fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE,
- NULL, 0);
- dput(dentry);
+ parent = kernfs_get_parent(kn);
+ if (parent) {
+ struct inode *p_inode;
+
+ p_inode = ilookup(info->sb, parent->ino);
+ if (p_inode) {
+ fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD,
+ inode, FSNOTIFY_EVENT_INODE, kn->name, 0);
+ iput(p_inode);
+ }
+
+ kernfs_put(parent);
}
+ fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE,
+ kn->name, 0);
iput(inode);
}