Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v5 05/13] btrfs: delete stripe extent on extent deletion
Date: Wed, 8 Feb 2023 15:00:13 -0500	[thread overview]
Message-ID: <Y+P/TefZ1nwTpkAn@localhost.localdomain> (raw)
In-Reply-To: <28ff4b0398d52b27c93fac93297be8f0e2a18fab.1675853489.git.johannes.thumshirn@wdc.com>

On Wed, Feb 08, 2023 at 02:57:42AM -0800, Johannes Thumshirn wrote:
> As each stripe extent is tied to an extent item, delete the stripe extent
> once the corresponding extent item is deleted.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/btrfs/extent-tree.c      |  8 ++++++++
>  fs/btrfs/raid-stripe-tree.c | 31 +++++++++++++++++++++++++++++++
>  fs/btrfs/raid-stripe-tree.h |  2 ++
>  3 files changed, 41 insertions(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 50b3a2c3c0dd..f08ee7d9211c 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3238,6 +3238,14 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
>  			}
>  		}
>  
> +		if (is_data) {
> +			ret = btrfs_delete_raid_extent(trans, bytenr, num_bytes);
> +			if (ret) {
> +				btrfs_abort_transaction(trans, ret);
> +				return ret;
> +			}
> +		}
> +

We're still holding the path open, so now we have a lockdep thing of extent root
-> RST, which will for sure bite us in the ass in the future.  Push this part
just under this part of the code, after the btrfs_release_path().

Also since we have a path here, add it to the arguments for
btrfs_delete_raid_extent() so we don't have to allocate a new path.  Thanks,

Josef

  reply	other threads:[~2023-02-08 20:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 10:57 [PATCH v5 00/13] btrfs: introduce RAID stripe tree Johannes Thumshirn
2023-02-08 10:57 ` [PATCH v5 01/13] btrfs: re-add trans parameter to insert_delayed_ref Johannes Thumshirn
2023-02-08 19:41   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 02/13] btrfs: add raid stripe tree definitions Johannes Thumshirn
2023-02-08 19:42   ` Josef Bacik
2023-02-13  6:50   ` Christoph Hellwig
2023-02-13 11:10     ` Johannes Thumshirn
2023-02-13 11:34   ` Anand Jain
2023-02-08 10:57 ` [PATCH v5 03/13] btrfs: read raid-stripe-tree from disk Johannes Thumshirn
2023-02-08 19:43   ` Josef Bacik
2023-02-13 11:35   ` Anand Jain
2023-02-08 10:57 ` [PATCH v5 04/13] btrfs: add support for inserting raid stripe extents Johannes Thumshirn
2023-02-08 19:47   ` Josef Bacik
2023-02-08 19:52   ` Josef Bacik
2023-02-13  6:57   ` Christoph Hellwig
2023-02-13 10:43     ` Johannes Thumshirn
2023-02-13 13:12       ` Johannes Thumshirn
2023-02-13  7:40   ` Qu Wenruo
2023-02-13 10:49     ` Johannes Thumshirn
2023-02-13 11:12       ` Qu Wenruo
2023-02-13 11:37         ` Johannes Thumshirn
2023-02-08 10:57 ` [PATCH v5 05/13] btrfs: delete stripe extent on extent deletion Johannes Thumshirn
2023-02-08 20:00   ` Josef Bacik [this message]
2023-02-13 15:21     ` Johannes Thumshirn
2023-02-08 10:57 ` [PATCH v5 06/13] btrfs: lookup physical address from stripe extent Johannes Thumshirn
2023-02-08 20:16   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 07/13] btrfs: add raid stripe tree pretty printer Johannes Thumshirn
2023-02-08 10:57 ` [PATCH v5 08/13] btrfs: zoned: allow zoned RAID Johannes Thumshirn
2023-02-08 20:18   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 09/13] btrfs: check for leaks of ordered stripes on umount Johannes Thumshirn
2023-02-08 20:19   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 10/13] btrfs: add tracepoints for ordered stripes Johannes Thumshirn
2023-02-08 10:57 ` [PATCH v5 11/13] btrfs: announce presence of raid-stripe-tree in sysfs Johannes Thumshirn
2023-02-08 20:20   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 12/13] btrfs: consult raid-stripe-tree when scrubbing Johannes Thumshirn
2023-02-08 20:21   ` Josef Bacik
2023-02-08 10:57 ` [PATCH v5 13/13] btrfs: add raid-stripe-tree to features enabled with debug Johannes Thumshirn
2023-02-08 20:23   ` Josef Bacik
2023-02-09  0:42 ` [PATCH v5 00/13] btrfs: introduce RAID stripe tree Qu Wenruo
2023-02-09  8:47   ` Johannes Thumshirn
2023-02-09 15:57 ` Phillip Susi
2023-02-10  8:44   ` Johannes Thumshirn
2023-02-10 10:33     ` Johannes Thumshirn
2023-02-13 16:42     ` Phillip Susi
2023-02-13 17:44       ` Johannes Thumshirn
2023-02-13 17:56         ` Phillip Susi
2023-02-14  5:52           ` Christoph Hellwig
2023-02-14  5:51         ` Christoph Hellwig

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=Y+P/TefZ1nwTpkAn@localhost.localdomain \
    --to=josef@toxicpanda.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@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