mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
	Johannes Thumshirn <jth@kernel.org>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Qu Wenru <wqu@suse.com>, Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 2/2] btrfs: replace stripe extents
Date: Tue, 9 Jul 2024 07:30:56 +0000	[thread overview]
Message-ID: <09f08d98-a615-4952-9949-daf4a7119b96@wdc.com> (raw)
In-Reply-To: <4211723f-ddc9-4646-91c3-14a9a1769d22@gmx.com>

On 09.07.24 09:18, Qu Wenruo wrote:
> 
> 
> 在 2024/7/9 16:02, Johannes Thumshirn 写道:
>> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>
>> Update stripe extents in case a write to an already existing address
>> incoming.
>>
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> Looks good to me.
> 
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> 
> But still as I mentioned in the original thread, I'm wondering why
> dev-replace of RST needs to update RST entry.
> 
> I'd prefer to do a dev-extent level copy so that no RST/chunk needs to
> be updated, just like what we did for non-RST cases.
> 
> But so far the change should be good enough for us to continue the testing.

I /think/ I have a fix for the ASSERT() as well. It survived btrfs/060 
once already (which it hasn't before) and it's trivial and I feel stupid 
for it:

diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c
index fd56535b2289..6b1c6004f94c 100644
--- a/fs/btrfs/raid-stripe-tree.c
+++ b/fs/btrfs/raid-stripe-tree.c
@@ -57,6 +57,9 @@ int btrfs_delete_raid_extent(struct btrfs_trans_handle 
*trans, u64 start, u64 le
                 /* That stripe ends before we start, we're done. */
                 if (found_end <= start)
                         break;
+               /* That stripe starts after we end, we're done as well */
+               if (found_start >= end)
+                       break;

                 trace_btrfs_raid_extent_delete(fs_info, start, end,
                                                found_start, found_end);


  reply	other threads:[~2024-07-09  7:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-09  6:32 [PATCH 0/2] btrfs: more RAID stripe tree updates Johannes Thumshirn
2024-07-09  6:32 ` [PATCH 1/2] btrfs: don't hold dev_replace rwsem over whole of btrfs_map_block Johannes Thumshirn
2024-07-09  6:32 ` [PATCH 2/2] btrfs: replace stripe extents Johannes Thumshirn
2024-07-09  7:18   ` Qu Wenruo
2024-07-09  7:30     ` Johannes Thumshirn [this message]
2024-07-09  7:46       ` Qu Wenruo
2024-07-09  8:44         ` Johannes Thumshirn

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=09f08d98-a615-4952-9949-daf4a7119b96@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=jth@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®