[Cluster-devel] [PATCH v2 17/19] md: raid1: check if adding pages to resync bio fails

Song Liu song at kernel.org
Mon Apr 10 16:06:06 UTC 2023


On Tue, Apr 4, 2023 at 1:26 AM Johannes Thumshirn <jth at kernel.org> wrote:
>
> On 31/03/2023 20:13, Song Liu wrote:
> > On Thu, Mar 30, 2023 at 3:44 AM Johannes Thumshirn
> > <johannes.thumshirn at wdc.com> wrote:
> >>
> >> Check if adding pages to resync bio fails and if bail out.
> >>
> >> As the comment above suggests this cannot happen, WARN if it actually
> >> happens.
> >>
> >> This way we can mark bio_add_pages as __must_check.
> >>
> >> Signed-off-by: Johannes Thumshirn <johannes.thumshirn at wdc.com>
> >> Reviewed-by: Damien Le Moal <damien.lemoal at opensource.wdc.com>
> >> ---
> >>   drivers/md/raid1-10.c |  7 ++++++-
> >>   drivers/md/raid10.c   | 12 ++++++++++--
> >>   2 files changed, 16 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
> >> index e61f6cad4e08..c21b6c168751 100644
> >> --- a/drivers/md/raid1-10.c
> >> +++ b/drivers/md/raid1-10.c
> >> @@ -105,7 +105,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp,
> >>                   * won't fail because the vec table is big
> >>                   * enough to hold all these pages
> >>                   */
> >
> > We know these won't fail. Shall we just use __bio_add_page?
>
> We could yes, but I kind of like the assert() style warning.
> But of cause ultimately your call.

The assert() style warning is fine. In this case, please remove the
"won't fail ..." comments.

Thanks,
Song



More information about the Cluster-devel mailing list