mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
ANDROID: fsnotify: Notify lower fs of open
If the filesystem being watched supports d_canonical_path, notify the lower filesystem of the open as well. Fixes:f37e05049b("ANDROID: vfs: d_canonical_path for stacked FS") Test: atest CtsOsTestCases:android.os.cts.FileObserverTest Bug: 70706497 Signed-off-by: Daniel Rosenberg <drosen@google.com> Signed-off-by: Paul Lawrence <paullawrence@google.com> Signed-off-by: Alessio Balsini <balsini@google.com> Change-Id: I7c9d210e8e6ee99928ad9db0b41ffc3ac3371dc0 (cherry picked from commitb289d1706b)
This commit is contained in:
committed by
Treehugger Robot
parent
3355e398f3
commit
c0b8bfdecf
@@ -96,6 +96,25 @@ static inline int fsnotify_file(struct file *file, __u32 mask)
|
||||
if (file->f_mode & FMODE_NONOTIFY)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Open calls notify early on, so lower file system must be notified
|
||||
*/
|
||||
if (mask & FS_OPEN) {
|
||||
if (path->dentry->d_op &&
|
||||
path->dentry->d_op->d_canonical_path) {
|
||||
struct path lower_path;
|
||||
int ret;
|
||||
|
||||
path->dentry->d_op->d_canonical_path(path, &lower_path);
|
||||
ret = fsnotify_parent(lower_path.dentry, mask,
|
||||
&lower_path, FSNOTIFY_EVENT_PATH);
|
||||
path_put(&lower_path);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return fsnotify_parent(path->dentry, mask, path, FSNOTIFY_EVENT_PATH);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user