lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250819215510.GD7942@frogsfrogsfrogs>
Date: Tue, 19 Aug 2025 14:55:10 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: John Groves <John@...ves.net>
Cc: Miklos Szeredi <miklos@...redi.hu>,
	Dan Williams <dan.j.williams@...el.com>,
	Bernd Schubert <bschubert@....com>,
	John Groves <jgroves@...ron.com>, Jonathan Corbet <corbet@....net>,
	Vishal Verma <vishal.l.verma@...el.com>,
	Dave Jiang <dave.jiang@...el.com>,
	Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>,
	Randy Dunlap <rdunlap@...radead.org>,
	Jeff Layton <jlayton@...nel.org>,
	Kent Overstreet <kent.overstreet@...ux.dev>,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	nvdimm@...ts.linux.dev, linux-cxl@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, Amir Goldstein <amir73il@...il.com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	Stefan Hajnoczi <shajnocz@...hat.com>,
	Joanne Koong <joannelkoong@...il.com>,
	Josef Bacik <josef@...icpanda.com>,
	Aravind Ramesh <arramesh@...ron.com>,
	Ajay Joshi <ajayjoshi@...ron.com>
Subject: Re: [RFC V2 12/18] famfs_fuse: Plumb the GET_FMAP message/response

On Fri, Aug 15, 2025 at 10:06:01AM -0500, John Groves wrote:
> On 25/08/14 11:20AM, Darrick J. Wong wrote:
> > On Thu, Aug 14, 2025 at 04:36:57PM +0200, Miklos Szeredi wrote:
> > > On Thu, 14 Aug 2025 at 15:36, Miklos Szeredi <miklos@...redi.hu> wrote:
> > > 
> > > > I'm still hoping some common ground would benefit both interfaces.
> > > > Just not sure what it should be.
> > > 
> > > Something very high level:
> > > 
> > >  - allow several map formats: say a plain one with a list of extents
> > > and a famfs one
> > 
> > Yes, I think that's needed.
> 
> Agreed
> 
> > 
> > >  - allow several types of backing files: say regular and dax dev
> > 
> > "block device", for iomap.
> > 
> > >  - querying maps has a common protocol, format of maps is opaque to this
> > >  - maps are cached by a common facility
> > 
> > I've written such a cache already. :)
> 
> I guess I need to take a look at that. Can you point me to the right place?
> 
> > 
> > >  - each type of mapping has a decoder module
> > 
> > I don't know that you need much "decoding" -- for famfs, the regular
> > mappings correspond to FUSE_IOMAP_TYPE_MAPPED.  The one goofy part is
> > the device cookie in each IO mapping: fuse-iomap maps each block device
> > you give it to a device cookie, so I guess famfs will have to do the
> > same.
> > 
> > OTOH you can then have a famfs backed by many persistent memory
> > devices.
> 
> That's handled in the famfs fmaps already. When an fmap is ingested,
> if it references any previously-unknown daxdevs, they get retrieved
> (FUSE_GET_DAXDEV).
> 
> Oversimplifying a bit, I assume that famfs fmaps won't really change,
> they'll just be retrieved by a more flexible method and be preceded
> by a header that identifies the payload as a famfs fmap.

<nod> Well, I suppose fmaps aren't supposed to change much, but I get
the strong sense that Miklos would rather we both use the
FUSE_DEV_IOC_BACKING_OPEN interface...

> > 
> > >  - each type of backing file has a module for handling I/O
> > > 
> > > Does this make sense?
> > 
> > More or less.
> 
> I'm nervous about going for too much generalization too soon here,
> but otherwise yeah.

...and I've tried to make it simple for famfs to pick up the interface.
>From the new fuse_backing_open:

	/*
	 * Each _backing_open function should either:
	 *
	 * 1. Take a ref to fb if it wants the file and return 0.
	 * 2. Return 0 without taking a ref if the backing file isn't needed.
	 * 3. Return an errno explaining why it couldn't attach.
	 *
	 * If at least one subsystem bumps the reference count to open it,
	 * we'll install it into the index and return the index.  If nobody
	 * opens the file, the error code will be passed up.  EPERM is the
	 * default.
	 */
	passthrough_res = fuse_passthrough_backing_open(fc, fb);
	iomap_res = fuse_iomap_backing_open(fc, fb);

	if (refcount_read(&fb->count) < 2)
		/* drop the fuse_backing and return one of the res */

So all your famfs_backing_open function has to do is check that fb->file
points to a pmem device.  If so, it sets fb->famfs = 1 and bumps the
fb->count refcount.

Full code here:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/log/?h=fuse-iomap-attrs_2025-08-19

I'll let the build robots find any facepalm problems and post this whole
series tomorrow.

> > > This doesn't have to be implemented in one go, but for example
> > > GET_FMAP could be renamed to GET_READ_MAP with an added offset and
> > > size parameter.  For famfs the offset/size would be set to zero/inf.
> > > I'd be content with that for now.
> > 
> > I'll try to cough up a RFC v4 next week.
> 
> Darrick, let's try to chat next week to compare notes.
> 
> Based on this thinking, I will keep my rework of GET_FMAP to a minimum
> since that will likely be a new shared message/response. I think that
> part can be merged later in the cycle...

<nod>

--D

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ