linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: Boris Burkov <boris@bur.io>,
	fstests@vger.kernel.org, linux-fscrypt@vger.kernel.org,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v13 4/5] btrfs: test verity orphans with dmlogwrites
Date: Wed, 20 Jul 2022 10:30:27 -0400	[thread overview]
Message-ID: <14f33fb7-c7f1-5463-ad4a-fe031d2a8583@dorminy.me> (raw)
In-Reply-To: <57123fe31da2886cfae01e27ffc43095ef7db7d1.1658277755.git.boris@bur.io>

On 7/19/22 20:49, Boris Burkov wrote:
> The behavior of orphans is most interesting across mounts, interrupted
> at arbitrary points during fsverity enable. To cover as many such cases
> as possible, use dmlogwrites and dmsnapshot as in
> log-writes/replay-individual.sh. As we replay the log events, we run a
> state machine with different invariants enforced at each state.
> 
> There are three possible states for a given point in the log:
> 0. Verity has not yet started
> 1. Verity has started but not finished
> 2. Verity has finished.
> 
> The possible transitions with causes are:
> 0->1: We see an orphan item for the file.
> 1->2: Running 'fsverity measure' succeeds on the file.
> 
> Each state has its own invariant for testing:
> 0: No verity items exist.
> 1: Mount should handle the orphan and blow away verity data: expect 0
>     Merkle items after mounting.
> 2: The orphan should be gone and mount should not blow away merkle
>     items. Expect the same number of merkle items before and after
>     mounting.
> 
> As a result, we can be confident that if the file system loses power at
> any point during enabling verity on a file, the work is either completed,
> or gets rolled-back by mount.
> 
> Signed-off-by: Boris Burkov <boris@bur.io>
> Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> ---
>   tests/btrfs/291     | 168 ++++++++++++++++++++++++++++++++++++++++++++
>   tests/btrfs/291.out |   2 +
>   2 files changed, 170 insertions(+)
>   create mode 100755 tests/btrfs/291
>   create mode 100644 tests/btrfs/291.out
> 

Still looks good to me, with the fua-hunting rewrite.

It occurred to me last night that the test doesn't verify that it sees a 
disk state in state 1 -- theoretically it could go directly from state 0 
to state 2 -- but I don't see a good way to ensure the test spends time 
in state 1.

  reply	other threads:[~2022-07-20 14:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  0:49 [PATCH v13 0/5] tests for btrfs fsverity Boris Burkov
2022-07-20  0:49 ` [PATCH v13 1/5] common/verity: require corruption functionality Boris Burkov
2022-07-20  0:49 ` [PATCH v13 2/5] common/verity: support btrfs in generic fsverity tests Boris Burkov
2022-07-25 18:41   ` Eric Biggers
2022-07-20  0:49 ` [PATCH v13 3/5] btrfs: test btrfs specific fsverity corruption Boris Burkov
2022-07-20  0:49 ` [PATCH v13 4/5] btrfs: test verity orphans with dmlogwrites Boris Burkov
2022-07-20 14:30   ` Sweet Tea Dorminy [this message]
2022-07-20  0:49 ` [PATCH v13 5/5] generic: test fs-verity EFBIG scenarios Boris Burkov
2022-07-20 14:13 ` [PATCH v13 0/5] tests for btrfs fsverity Josef Bacik

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=14f33fb7-c7f1-5463-ad4a-fe031d2a8583@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=boris@bur.io \
    --cc=fstests@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).