Re: [PATCH RFC 5/6] md/raid1: Handle bio_split() errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/09/2024 07:15, Yu Kuai wrote:

Hi Kuai,

iff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 6c9d24203f39..c561e2d185e2 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1383,6 +1383,10 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
      if (max_sectors < bio_sectors(bio)) {
          struct bio *split = bio_split(bio, max_sectors,
                            gfp, &conf->bio_split);
+        if (IS_ERR(split)) {
+            raid_end_bio_io(r1_bio);
+            return;
+        }

This way, BLK_STS_IOERR will always be returned, perhaps what you want
is to return the error code from bio_split()?

I am not sure on the best way to pass the bio_split() error code to bio->bi_status.

I could just have this pattern:

bio->bi_status = errno_to_blk_status(err);
set_bit(R1BIO_Uptodate, &r1_bio->state);
raid_end_bio_io(r1_bio);

Is there a neater way to do this?

Thanks,
John





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux