[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200722231258.GA83434@sol.localdomain>
Date: Wed, 22 Jul 2020 16:12:58 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Dave Chinner <david@...morbit.com>,
Satya Tangirala <satyat@...gle.com>,
linux-fscrypt@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org
Subject: Re: [PATCH v4 3/7] iomap: support direct I/O with fscrypt using
blk-crypto
On Wed, Jul 22, 2020 at 11:44:07PM +0100, Matthew Wilcox wrote:
> On Wed, Jul 22, 2020 at 03:34:04PM -0700, Eric Biggers wrote:
> > > Which means you are now placing a new constraint on this code in
> > > that we cannot ever, in future, zero entire blocks here.
> > >
> > > This code can issue arbitrary sized zeroing bios - multiple entire fs blocks
> > > blocks if necessary - so I think constraining it to only support
> > > partial block zeroing by adding a warning like this is no correct.
> >
> > In v3 and earlier this instead had the code to set an encryption context:
> >
> > fscrypt_set_bio_crypt_ctx(bio, inode, pos >> inode->i_blkbits,
> > GFP_KERNEL);
> >
> > Would you prefer that, even though the call to fscrypt_set_bio_crypt_ctx() would
> > always be a no-op currently (since for now, iomap_dio_zero() will never be
> > called with an encrypted file) and thus wouldn't be properly tested?
> >
> > BTW, iomap_dio_zero() is actually limited to one page, so it's not quite
> > "arbitrary sizes".
>
> I have a patch for that
>
> http://git.infradead.org/users/willy/pagecache.git/commitdiff/1a4d72a890ca9c2ea3d244a6153511ae674ce1d8
No you don't :-) Your patch is for iomap_zero_range() in
fs/iomap/buffered-io.c. It doesn't touch fs/iomap/direct-io.c which is what
we're talking about here.
> It's not going to cause a problem for crossing a 2^32 boundary because
> pages are naturally aligned and don't get that big.
Well, the boundary can actually occur at any block. But it's not relevant here
because (a) fs/iomap/buffered-io.c doesn't yet support encryption anyway, since
neither ext4 nor f2fs use it; and (b) iomap_zero_range() just writes to the
pagecache, and the bios aren't actually issued until ->writepages().
- Eric
Powered by blists - more mailing lists