mbox series

[0/7] ext4 fast-commit fixes

Message ID 20221106224841.279231-1-ebiggers@kernel.org (mailing list archive)
Headers show
Series ext4 fast-commit fixes | expand

Message

Eric Biggers Nov. 6, 2022, 10:48 p.m. UTC
From: Eric Biggers <ebiggers@kernel.org

This series fixes several bugs in the fast-commit feature.

Patch 6 may be the most controversial patch of this series, since it
would make old kernels unable to replay fast-commit journals created by
new kernels.  I'd appreciate any thoughts on whether that's okay.  I can
drop that patch if needed.

I've tested that this series doesn't introduce any regressions with
'gce-xfstests -c ext4/fast_commit -g auto'.  Note that ext4/039,
ext4/053, and generic/475 fail both before and after.

Eric Biggers (7):
  ext4: disable fast-commit of encrypted dir operations
  ext4: don't set up encryption key during jbd2 transaction
  ext4: fix leaking uninitialized memory in fast-commit journal
  ext4: add missing validation of fast-commit record lengths
  ext4: fix unaligned memory access in ext4_fc_reserve_space()
  ext4: fix off-by-one errors in fast-commit block filling
  ext4: simplify fast-commit CRC calculation

 fs/ext4/ext4.h              |   4 +-
 fs/ext4/fast_commit.c       | 203 ++++++++++++++++++------------------
 fs/ext4/fast_commit.h       |   3 +-
 fs/ext4/namei.c             |  44 ++++----
 include/trace/events/ext4.h |   7 +-
 5 files changed, 132 insertions(+), 129 deletions(-)


base-commit: 089d1c31224e6b266ece3ee555a3ea2c9acbe5c2

Comments

Eric Biggers Nov. 16, 2022, 1:18 a.m. UTC | #1
On Sun, Nov 06, 2022 at 02:48:34PM -0800, Eric Biggers wrote:
> 
> This series fixes several bugs in the fast-commit feature.
> 
> Patch 6 may be the most controversial patch of this series, since it
> would make old kernels unable to replay fast-commit journals created by
> new kernels.  I'd appreciate any thoughts on whether that's okay.  I can
> drop that patch if needed.
> 
> I've tested that this series doesn't introduce any regressions with
> 'gce-xfstests -c ext4/fast_commit -g auto'.  Note that ext4/039,
> ext4/053, and generic/475 fail both before and after.
> 
> Eric Biggers (7):
>   ext4: disable fast-commit of encrypted dir operations
>   ext4: don't set up encryption key during jbd2 transaction
>   ext4: fix leaking uninitialized memory in fast-commit journal
>   ext4: add missing validation of fast-commit record lengths
>   ext4: fix unaligned memory access in ext4_fc_reserve_space()
>   ext4: fix off-by-one errors in fast-commit block filling
>   ext4: simplify fast-commit CRC calculation
> 
>  fs/ext4/ext4.h              |   4 +-
>  fs/ext4/fast_commit.c       | 203 ++++++++++++++++++------------------
>  fs/ext4/fast_commit.h       |   3 +-
>  fs/ext4/namei.c             |  44 ++++----
>  include/trace/events/ext4.h |   7 +-
>  5 files changed, 132 insertions(+), 129 deletions(-)
> 
> 
> base-commit: 089d1c31224e6b266ece3ee555a3ea2c9acbe5c2

Any thoughts on this patch series?

- Eric
Eric Biggers Nov. 28, 2022, 7:03 p.m. UTC | #2
On Tue, Nov 15, 2022 at 05:18:11PM -0800, Eric Biggers wrote:
> On Sun, Nov 06, 2022 at 02:48:34PM -0800, Eric Biggers wrote:
> > 
> > This series fixes several bugs in the fast-commit feature.
> > 
> > Patch 6 may be the most controversial patch of this series, since it
> > would make old kernels unable to replay fast-commit journals created by
> > new kernels.  I'd appreciate any thoughts on whether that's okay.  I can
> > drop that patch if needed.
> > 
> > I've tested that this series doesn't introduce any regressions with
> > 'gce-xfstests -c ext4/fast_commit -g auto'.  Note that ext4/039,
> > ext4/053, and generic/475 fail both before and after.
> > 
> > Eric Biggers (7):
> >   ext4: disable fast-commit of encrypted dir operations
> >   ext4: don't set up encryption key during jbd2 transaction
> >   ext4: fix leaking uninitialized memory in fast-commit journal
> >   ext4: add missing validation of fast-commit record lengths
> >   ext4: fix unaligned memory access in ext4_fc_reserve_space()
> >   ext4: fix off-by-one errors in fast-commit block filling
> >   ext4: simplify fast-commit CRC calculation
> > 
> >  fs/ext4/ext4.h              |   4 +-
> >  fs/ext4/fast_commit.c       | 203 ++++++++++++++++++------------------
> >  fs/ext4/fast_commit.h       |   3 +-
> >  fs/ext4/namei.c             |  44 ++++----
> >  include/trace/events/ext4.h |   7 +-
> >  5 files changed, 132 insertions(+), 129 deletions(-)
> > 
> > 
> > base-commit: 089d1c31224e6b266ece3ee555a3ea2c9acbe5c2
> 
> Any thoughts on this patch series?
> 
> - Eric

Ping?

- Eric
Theodore Ts'o Dec. 6, 2022, 9:04 p.m. UTC | #3
On Sun, Nov 06, 2022 at 02:48:34PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@kernel.org
> 
> This series fixes several bugs in the fast-commit feature.
> 
> Patch 6 may be the most controversial patch of this series, since it
> would make old kernels unable to replay fast-commit journals created by
> new kernels.  I'd appreciate any thoughts on whether that's okay.  I can
> drop that patch if needed.

Mumble.  Normally, it's something we would avoid, since there aren't
that many users using fast commit, since it's not enabled by default.
And given that the off-by-one errors are bugs, an it's a question of
old kernels requiring a pretty buggy layout, the question is whether
it's worth it to do an explicit version / feature flag and support
both for some period of time.

I'm inclined to say no, and just let things slide, and instead make
sure that e2fsck can handle both the old and the new format, and let
that handle the fast commit replay if necessary.

Harshad, what do you think?

						- Ted
harshad shirwadkar Dec. 9, 2022, 4:12 p.m. UTC | #4
On Tue, 6 Dec 2022 at 13:04, Theodore Ts'o <tytso@mit.edu> wrote:
>
> On Sun, Nov 06, 2022 at 02:48:34PM -0800, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@kernel.org
> >
> > This series fixes several bugs in the fast-commit feature.
> >
> > Patch 6 may be the most controversial patch of this series, since it
> > would make old kernels unable to replay fast-commit journals created by
> > new kernels.  I'd appreciate any thoughts on whether that's okay.  I can
> > drop that patch if needed.
>
> Mumble.  Normally, it's something we would avoid, since there aren't
> that many users using fast commit, since it's not enabled by default.
> And given that the off-by-one errors are bugs, an it's a question of
> old kernels requiring a pretty buggy layout, the question is whether
> it's worth it to do an explicit version / feature flag and support
> both for some period of time.
>
> I'm inclined to say no, and just let things slide, and instead make
> sure that e2fsck can handle both the old and the new format, and let
> that handle the fast commit replay if necessary.
>
> Harshad, what do you think?
I agree. Making kernel replay backward compatible would complicate the
replay code without adding that much value (since there aren't that
many users and fast commit isn't enabled by default). So, having the
ability in e2fsck to do replays should suffice in this case.

- Harshad
>
>                                                 - Ted