public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "Darrick J. Wong" <djwong@kernel.org>,
	Demi Marie Obenour <demiobenour@gmail.com>
Cc: bernd@bsbernd.com, joannelkoong@gmail.com,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	miklos@szeredi.hu, neal@gompa.dev,
	linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org,
	zfs-devel@list.zfsonlinux.org
Subject: Re: [PATCHSET v6 4/8] fuse: allow servers to use iomap for better file IO performance
Date: Thu, 20 Nov 2025 05:51:07 +0800	[thread overview]
Message-ID: <1be4cb25-50e2-46fa-ba86-d6342e997e63@linux.alibaba.com> (raw)
In-Reply-To: <af9a8030-cd19-457c-8c15-cb63e8140dfc@linux.alibaba.com>



On 2025/11/20 05:00, Gao Xiang wrote:
> 
> 
> On 2025/11/20 02:04, Darrick J. Wong wrote:
>> On Wed, Nov 19, 2025 at 04:19:36AM -0500, Demi Marie Obenour wrote:
>>>> By keeping the I/O path mostly within the kernel, we can dramatically
>>>> increase the speed of disk-based filesystems.
>>>
>>> ZFS, BTRFS, and bcachefs all support compression, checksumming,
>>> and RAID.  ZFS and bcachefs also support encryption, and f2fs and
>>> ext4 support fscrypt.
>>>
>>> Will this patchset be able to improve FUSE implementations of these
>>> filesystems?  I'd rather not be in the situation where one can have
>>> a FUSE filesystem that is fast, but only if it doesn't support modern
>>> data integrity or security features.
>>
>> Not on its own, no.
>>
>>> I'm not a filesystem developer, but here are some ideas (that you
>>> can take or leave):
>>>
>>> 1. Keep the compression, checksumming, and/or encryption in-kernel,
>>>     and have userspace tell the kernel what algorithm and/or encryption
>>>     key to use.  These algorithms are generally well-known and secure
>>>     against malicious input.  It might be necessary to make an extra
>>>     data copy, but ideally that copy could just stay within the
>>>     CPU caches.
>>
>> I think this is easily doable for fscrypt and compression since (IIRC)
>> the kernel filesystems already know how to transform data for I/O, and
>> nowadays iomap allows hooking of bios before submission and/or after
>> endio.  Obviously you'd have to store encryption keys in the kernel
>> somewhere.
> 
> I think it depends, since (this way) it tries to reuse some of the
> existing kernel filesystem implementations (and assuming the code is
> safe), so at least it still needs to load a dedicated kernel module
> for such usage at least.
> 
> I think it's not an issue for userspace ext4 of course (because ext4
> and fscrypt is almost builtin for all kernels), but for out-of-tree
> fses even pure userspace fses, I'm not sure it's doable to load the
> module in a container context.

Two examples for reference:

  - For compression, in-tree f2fs already has a compression header
    in data of each compressed extent:
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/f2fs/f2fs.h?h=v6.17#n1497

    while other fs may store additional metadata in extent metadata
    or other place.

  - gocryptfs (a pure userspace FUSE fs) uses a different format
    from fscrypt (encrypted data seems even unaligned on disk):
    https://github.com/rfjakob/gocryptfs/blob/master/Documentation/file-format.md

> 
> Maybe eBPF is useful for this area, but it's still not quite
> flexible compared to native kernel filesystems.
> 
> Thanks,
> Gao Xiang


  reply	other threads:[~2025-11-19 21:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <176169810144.1424854.11439355400009006946.stgit@frogsfrogsfrogs>
2025-11-19  9:19 ` [PATCHSET v6 4/8] fuse: allow servers to use iomap for better file IO performance Demi Marie Obenour
2025-11-19  9:41   ` Gao Xiang
2025-11-19 18:04   ` Darrick J. Wong
2025-11-19 21:00     ` Gao Xiang
2025-11-19 21:51       ` Gao Xiang [this message]
2025-11-20  1:13         ` Demi Marie Obenour
2025-11-20  1:10       ` Demi Marie Obenour
2025-11-20  1:49         ` Gao Xiang
2025-11-20  1:05     ` Demi Marie Obenour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1be4cb25-50e2-46fa-ba86-d6342e997e63@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=bernd@bsbernd.com \
    --cc=demiobenour@gmail.com \
    --cc=djwong@kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neal@gompa.dev \
    --cc=zfs-devel@list.zfsonlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox