From 055518d9f3bfdd13432cd33c239d6688ef60ed81 Mon Sep 17 00:00:00 2001 From: Richard Fung Date: Mon, 20 May 2024 21:45:43 +0000 Subject: [PATCH] ANDROID: fuse: Skip canonical path logic if ENOSYS Not all FUSE servers have implemented canonical_path such as virtiofs. This patch makes it so they go through the same logic as other filesystems that don't have canonical path implemented. Bug: 330136711 Test: ./cts-tradefed run commandAndExit cts -m CtsIncidentHostTestCases -t com.android.server.cts.ErrorsTest#testTombstone Change-Id: I35f19bd1a12420015128ac9bc2662b9bd252a612 Signed-off-by: Richard Fung (cherry picked from commit 4b0be62caf6923eac6acdb5a44eb03688e6f9dc5) --- fs/notify/inotify/inotify_user.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); + } } }