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 <richardfung@google.com>
(cherry picked from commit 4b0be62caf6923eac6acdb5a44eb03688e6f9dc5)
This commit is contained in:
Richard Fung
2024-05-20 21:45:43 +00:00
committed by Treehugger Robot
parent a112c9c24c
commit 055518d9f3

View File

@@ -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);
}
}
}