From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Cc: Qu Wenru <wqu@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH 2/4] btrfs: break loop in case set_io_stripe fails
Date: Mon, 18 Sep 2023 07:14:31 -0700 [thread overview]
Message-ID: <20230918-rst-updates-v1-2-17686dc06859@wdc.com> (raw)
In-Reply-To: <20230918-rst-updates-v1-0-17686dc06859@wdc.com>
Break out of the loop in case st_io_stripe() fails.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
fs/btrfs/volumes.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0c5bd8d2ea06..d2a0ae9d91c4 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6576,11 +6576,15 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
*/
bioc->full_stripe_logical = em->start +
btrfs_stripe_nr_to_offset(stripe_nr * data_stripes);
- for (i = 0; i < num_stripes; i++)
+ for (i = 0; i < num_stripes; i++) {
ret = set_io_stripe(fs_info, op, logical, length,
&bioc->stripes[i], map,
(i + stripe_nr) % num_stripes,
stripe_offset, stripe_nr);
+ if (ret)
+ break;
+ }
+
} else {
/*
* For all other non-RAID56 profiles, just copy the target
@@ -6590,6 +6594,8 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
ret = set_io_stripe(fs_info, op, logical, length,
&bioc->stripes[i], map, stripe_index,
stripe_offset, stripe_nr);
+ if (ret)
+ break;
stripe_index++;
}
}
--
2.41.0
next prev parent reply other threads:[~2023-09-18 15:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 14:14 [PATCH 0/4] btrfs: RAID stripe tree updates Johannes Thumshirn
2023-09-18 14:14 ` [PATCH 1/4] btrfs: fix 64bit division in btrfs_insert_striped_mirrored_raid_extents Johannes Thumshirn
2023-09-18 14:18 ` Geert Uytterhoeven
2023-09-18 15:03 ` Johannes Thumshirn
2023-09-18 16:24 ` David Sterba
2023-09-18 18:31 ` Geert Uytterhoeven
2023-09-18 21:07 ` David Sterba
2023-09-19 0:37 ` Qu Wenruo
2023-09-19 13:58 ` David Sterba
2023-09-19 21:50 ` Qu Wenruo
2023-09-20 15:34 ` David Sterba
2023-09-18 14:14 ` Johannes Thumshirn [this message]
2023-09-18 14:14 ` [PATCH 3/4] btrfs: rename ordered_enmtry in btrfs_io_context Johannes Thumshirn
2023-09-18 14:14 ` [PATCH 4/4] btrfs: add tree-checker for RAID-stripe-tree Johannes Thumshirn
2023-09-19 0:30 ` Qu Wenruo
2023-09-18 16:39 ` [PATCH 0/4] btrfs: RAID stripe tree updates David Sterba
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=20230918-rst-updates-v1-2-17686dc06859@wdc.com \
--to=johannes.thumshirn@wdc.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).