Re: [PATCH] fscrypt: Change fscrypt_encrypt_pagecache_blocks() to take a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2025 at 05:35:09AM +0000, Matthew Wilcox wrote:
> On Thu, Feb 20, 2025 at 09:16:07PM -0800, Eric Biggers wrote:
> > On Fri, Feb 21, 2025 at 05:10:01AM +0000, Matthew Wilcox (Oracle) wrote:
> > > ext4 and ceph already have a folio to pass; f2fs needs to be properly
> > > converted but this will do for now.  This removes a reference
> > > to page->index and page->mapping as well as removing a call to
> > > compound_head().
> > > 
> > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
> > 
> > It's still assumed to be a small folio though, right?  It still just allocates a
> > "bounce page", not a "bounce folio".
> 
> Yup, I haven't figured out how to do large folio support, so any
> filesystem using fscrypt can't support large folios for now.  I'm
> working on "separate folio and page" at the moment rather than "enable
> large folios everywhere".  

It might be a good idea to make the limitation to small folios clear in the
function's kerneldoc and/or in a WARN_ON_ONCE().

> Maybe someone else will figure out how to
> support large folios in fscrypt and I won't have to ;-)

Decryption is easy and already done, but encryption is harder.  We have to
encrypt into bounce pages, since we can't overwrite the plaintext in the page
cache.  And when encrypting a large folio, I don't think we can rely on being
able to allocate a large bounce folio of the same size; it may just not be
available at the time.  So we'd still need bounce pages, and the filesystem
would have to keep track of potentially multiple bounce pages per folio.

However, this is all specific to the original fs-layer file contents encryption
path.  The newer inline crypto one should just work, even without hardware
support since block/blk-crypto-fallback.c would be used.  (blk-crypto-fallback
operates at the bio level, handles en/decryption, and manages bounce pages
itself.)  It actually might be time to remove the fs-layer file contents
encryption path and just support the inline crypto one.

- Eric




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux