
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBCU3L -------------------------------- Commit 7d1cf5e624ef ("vfs: generate FS_CREATE before FS_OPEN when ->atomic_open used.") removed fsnotify_open from do_dentry_open, which results in fsnotify_open not being called anymore when invoking backing_file_open. As a result, the fanotify13 test case in the ltp test suite fails: fanotify13.c:222: TFAIL: Unexpected mask received: 10 (expected: 30) in event Add a call to fsnotify_open after a successful do_dentry_open invocation in backing_file_open. Fixes: 7d1cf5e624ef ("vfs: generate FS_CREATE before FS_OPEN when ->atomic_open used.") Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/backing-file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/backing-file.c b/fs/backing-file.c index e1a4b23b255b..184bfce0ea75 100644 --- a/fs/backing-file.c +++ b/fs/backing-file.c @@ -12,6 +12,7 @@ #include <linux/backing-file.h> #include <linux/splice.h> #include <linux/mm.h> +#include <linux/fsnotify.h> #include "internal.h" @@ -46,6 +47,8 @@ struct file *backing_file_open(const struct path *user_path, int flags, if (error) { fput(f); f = ERR_PTR(error); + } else { + fsnotify_open(f); } return f; -- 2.31.1