All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Omar Sandoval <osandov@osandov.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4 7/9] Btrfs: add free space tree sanity tests
Date: Wed, 11 Oct 2023 12:20:20 +0200	[thread overview]
Message-ID: <20231011102020.GF2211@twin.jikos.cz> (raw)
In-Reply-To: <3f04845f-b9b5-68b6-90a0-8921eaa53b4d@huawei.com>

On Wed, Oct 11, 2023 at 10:12:37AM +0800, Jinjie Ruan wrote:
> 
> 
> On 2015/9/30 11:50, Omar Sandoval wrote:
     ^^^^^^^^^

> > From: Omar Sandoval <osandov@fb.com>
> > 
> > This tests the operations on the free space tree trying to excercise all
> > of the main cases for both formats. Between this and xfstests, the free
> > space tree should have pretty good coverage.
> > 
> > Signed-off-by: Omar Sandoval <osandov@fb.com>

> > +static int test_empty_block_group(struct btrfs_trans_handle *trans,
> > +				  struct btrfs_fs_info *fs_info,
> > +				  struct btrfs_block_group_cache *cache,
> > +				  struct btrfs_path *path)
> > +{
> > +	struct free_space_extent extents[] = {
> > +		{cache->key.objectid, cache->key.offset},
> > +	};
> > +
> > +	return check_free_space_extents(trans, fs_info, cache, path,
> > +					extents, ARRAY_SIZE(extents));
> 
> Inject fault when probe btrfs.ko,

I wonder how valid is fault injection during self tests, there are lot
of stub structures that are half-initialized and hitting a NULL could be
possible while the tests would not need it and knowingly ignore it.

The whole transaction abort mechanism cannot work reliably, there's no
single start or commit of the transaction in the test/ code so
an abort (in the regular code) can't work.

> there is a null-ptr-deref as below, it
> seems that the transaction in btrfs_trans_handle struct has not been
> initialized but used in __btrfs_abort_transaction() when calling
> WRITE_ONCE(trans->transaction->aborted, errno).

Yeah, not all structures are initialized.

  reply	other threads:[~2023-10-11 10:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30  3:50 [PATCH v4 0/9] Btrfs: free space B-tree Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 1/9] Btrfs: add extent buffer bitmap operations Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 2/9] Btrfs: add extent buffer bitmap sanity tests Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 3/9] Btrfs: add helpers for read-only compat bits Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 4/9] Btrfs: refactor caching_thread() Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 5/9] Btrfs: introduce the free space B-tree on-disk format Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 6/9] Btrfs: implement the free space B-tree Omar Sandoval
2015-09-30  4:35   ` kbuild test robot
2015-09-30  4:35   ` [PATCH] Btrfs: fix simple_return.cocci warnings kbuild test robot
2015-10-01 12:54   ` [PATCH v4 6/9] Btrfs: implement the free space B-tree David Sterba
2015-10-02 14:23   ` kbuild test robot
2015-12-29 20:19   ` Chris Mason
2016-04-22  8:28     ` Alex Lyakas
2016-05-02 21:55       ` Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 7/9] Btrfs: add free space tree sanity tests Omar Sandoval
2015-10-01 13:04   ` David Sterba
2023-10-11  2:12   ` Jinjie Ruan
2023-10-11 10:20     ` David Sterba [this message]
2015-09-30  3:50 ` [PATCH v4 8/9] Btrfs: wire up the free space tree to the extent tree Omar Sandoval
2015-09-30  3:50 ` [PATCH v4 9/9] Btrfs: add free space tree mount option Omar Sandoval
2015-09-30  3:51 ` [PATCH v4 1/2] btrfs-progs: add basic awareness of the free space tree Omar Sandoval
2015-09-30  3:51   ` [PATCH v4 2/2] btrfs-progs: check the free space tree in btrfsck Omar Sandoval
2015-09-30  8:31 ` [PATCH v4 0/9] Btrfs: free space B-tree Omar Sandoval
2015-10-02 11:47 ` Austin S Hemmelgarn
2015-11-03 18:13   ` Tobias Holst
2015-11-03 18:34     ` Chris Mason
2015-11-03 18:59       ` Tobias Holst

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=20231011102020.GF2211@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=ruanjinjie@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.