diff options
| author | Alex Shi <alex.shi@linaro.org> | 2016-10-11 23:33:37 +0200 |
|---|---|---|
| committer | Alex Shi <alex.shi@linaro.org> | 2016-10-11 23:33:37 +0200 |
| commit | 16d185eee470cf2dc3e909a59132893abfdd4b11 (patch) | |
| tree | e48bdb15a5e30feb76a3eed812054b836166b2b5 /fs/kernfs/file.c | |
| parent | 0a9cbce798bca52bb3476cb55ce33da27e100f3e (diff) | |
| parent | be2a76aecfc5ed58ddf8925190cc1cfb519bf932 (diff) | |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Conflicts:
kernel/cpuset.c
Diffstat (limited to 'fs/kernfs/file.c')
| -rw-r--r-- | fs/kernfs/file.c | 28 |
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); } |
