linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FUSE: anyway to return different stat::st_dev inside one filesystem?
@ 2021-11-08  2:22 Qu Wenruo
  2021-11-09  9:49 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2021-11-08  2:22 UTC (permalink / raw)
  To: Linux FS Devel, Miklos Szeredi

Hi FUSE guys,

Normally it's completely sane to let FUSE manage stat::st_dev, and most
FUSE filesystems are fine with that.

But there comes one problem, as I'm working on a FUSE btrfs read-only
implementation (*).

This limitation is getting more user affecting, as btrfs has subvolumes
which are completely different inode spaces.

Furthermore, all subvolume roots shares the same inode number (256),
thus if user space tool like "find" gets a inode number 256 with same
the st_dev number, it will treat it as a known directory, and skip its
content completely.

For kernel btrfs, it's not a big deal, as we will return different
st_dev for each subvolume.

But in FUSE, we don't have such ability, resulting "find" can only work
inside one subvolume, and nothing more.

So is there any limitation why FUSE can't not return different st_dev?


*: The project is here:
https://github.com/adam900710/btrfs-fuse

The reason I created such project is as an educational project, also an
alternative btrfs reference implementation for bootloaders.

Currently one can already explore the directory/files structure, and
proper data read with checksum verification/recovery is WIP.

Thanks,
Qu

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: FUSE: anyway to return different stat::st_dev inside one filesystem?
  2021-11-08  2:22 FUSE: anyway to return different stat::st_dev inside one filesystem? Qu Wenruo
@ 2021-11-09  9:49 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-11-09  9:49 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Linux FS Devel, Miklos Szeredi

On Mon, Nov 08, 2021 at 10:22:16AM +0800, Qu Wenruo wrote:
> For kernel btrfs, it's not a big deal, as we will return different
> st_dev for each subvolume.

It is a big deal, as that behavior does break things and has been the
source of constant troubnle and discussion.  It needs to be fixed in
btrfs eventually and absolutely not spread any further.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-09  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  2:22 FUSE: anyway to return different stat::st_dev inside one filesystem? Qu Wenruo
2021-11-09  9:49 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).