diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 6770f1f6d226..dd8764ac2048 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -426,7 +426,12 @@ static int fuse_dentry_canonical_path(const struct path *path, #ifdef CONFIG_FUSE_BPF struct fuse_err_ret fer; +#endif + if (fm->fc->no_dentry_canonical_path) + goto out; + +#ifdef CONFIG_FUSE_BPF fer = fuse_bpf_backing(inode, struct fuse_dummy_io, fuse_canonical_path_initialize, fuse_canonical_path_backing, @@ -453,9 +458,13 @@ static int fuse_dentry_canonical_path(const struct path *path, free_page((unsigned long)path_name); if (err > 0) return 0; - if (err < 0) + if (err < 0 && err != -ENOSYS) return err; + if (err == -ENOSYS) + fm->fc->no_dentry_canonical_path = 1; + +out: canonical_path->dentry = path->dentry; canonical_path->mnt = path->mnt; path_get(canonical_path); diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 723d462a54eb..5426ba83cb47 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -797,6 +797,9 @@ struct fuse_conn { /** Is bmap not implemented by fs? */ unsigned no_bmap:1; + /** Is dentry_canonical_path not implemented by fs? */ + unsigned no_dentry_canonical_path:1; + /** Is poll not implemented by fs? */ unsigned no_poll:1;