RAID code doubt

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

 



Question - in raid1.c, for example, I see:


    mbio = bio_clone(bio, GFP_NOIO);
    ...
    mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset;          
but I don't think bio_clone is GUARANTEED to produce a non-null result,
is it? It uses bio_alloc to get a bio, and bio_alloc does ...

        bio = mempool_alloc(bio_pool, gfp_mask);
        if (unlikely(!bio))
                goto out;

out:
                return bio;
        }

        mempool_free(bio, bio_pool);
        bio = NULL;
        goto out;
  
So it looks perfectly capable of producing a NULL.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux