diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index cc9bde854e5a..135d5f5456a0 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -786,11 +786,13 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, if (path.dentry->d_op->d_canonical_path) { ret = path.dentry->d_op->d_canonical_path(&path, &alteredpath); - if (ret) - goto path_put_and_out; - - canonical_path = &alteredpath; - path_put(&path); + if (ret != -ENOSYS) { + if (ret) { + goto path_put_and_out; + } + canonical_path = &alteredpath; + path_put(&path); + } } }