On Thu, Aug 14, 2025 at 08:25:23PM +0200, Miklos Szeredi wrote:
> On Thu, 14 Aug 2025 at 19:19, Darrick J. Wong <[email protected]> wrote:
> > What happens if you want to have a fuse server that hosts both famfs
> > files /and/ backing files?  That'd be pretty crazy to mix both paths in
> > one filesystem, but it's in theory possible, particularly if the famfs
> > server wanted to export a pseudofile where everyone could find that
> > shadow file?
> 
> Either FUSE_DEV_IOC_BACKING_OPEN detects what kind of object it has
> been handed, or we add a flag that explicitly says this is a dax dev
> or a block dev or a regular file.  I'd prefer the latter.

I don't think it's difficult to do something like:

        if (!fud)
                return -EPERM;

        if (copy_from_user(&map, argp, sizeof(map)))
                return -EFAULT;

        if (IS_ENABLED(CONFIG_FUSE_IOMAP)) {
                ret = fuse_iomap_dev_add(fud->fc, &map);
                if (ret)
                        return ret;
        }

        if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH))
                return fuse_backing_open(fud->fc, &map);

        return 0;

I guess the hard part is -- how do we return /two/ device cookies?
Or do we move the backing_files_map out of CONFIG_FUSE_PASSTHROUGH and
then let fuse-iomap/famfs extract the block/dax device from that?
Then the backing_id/device cookie would be the same across a fuse mount.
iomap would have to check that it's being given block devices, but
that's easy.

--D

> Thanks,
> Miklos
> 

Reply via email to