diff --git a/Documentation/ABI/testing/sysfs-fs-fuse b/Documentation/ABI/testing/sysfs-fs-fuse index b9956842b36f..9d14e572c2e7 100644 --- a/Documentation/ABI/testing/sysfs-fs-fuse +++ b/Documentation/ABI/testing/sysfs-fs-fuse @@ -5,6 +5,14 @@ Description: Read-only file that contains the word 'supported' if fuse-bpf is supported, does not exist otherwise +What: /sys/fs/fuse/features/fuse_passthrough +Date: February 2025 +Contact: Daniel Rosenberg +Description: + Read-only file that contains the word 'supported' if fuse + passthrough with Android modifications is supported, does not + exist otherwise + What: /sys/fs/fuse/bpf_prog_type_fuse Date: December 2022 Contact: Paul Lawrence diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1d003e300c52..a765b0910d6b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -2242,6 +2242,17 @@ static void fuse_fs_cleanup(void) static struct kobject *fuse_kobj; +#ifdef CONFIG_FUSE_PASSTHROUGH +static ssize_t fuse_passthrough_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) +{ + return sysfs_emit(buff, "supported\n"); +} + +static struct kobj_attribute fuse_passthrough_attr = + __ATTR_RO(fuse_passthrough); +#endif + static ssize_t fuse_bpf_show(struct kobject *kobj, struct kobj_attribute *attr, char *buff) { @@ -2251,14 +2262,17 @@ static ssize_t fuse_bpf_show(struct kobject *kobj, static struct kobj_attribute fuse_bpf_attr = __ATTR_RO(fuse_bpf); -static struct attribute *bpf_features[] = { +static struct attribute *fuse_features[] = { &fuse_bpf_attr.attr, +#ifdef CONFIG_FUSE_PASSTHROUGH + &fuse_passthrough_attr.attr, +#endif NULL, }; -static const struct attribute_group bpf_features_group = { +static const struct attribute_group fuse_features_group = { .name = "features", - .attrs = bpf_features, + .attrs = fuse_features, }; /* @@ -2286,7 +2300,7 @@ static const struct attribute_group bpf_attr_group = { }; static const struct attribute_group *attribute_groups[] = { - &bpf_features_group, + &fuse_features_group, &bpf_attr_group, NULL };