Hi Guoqing, On Fri, 17 Dec 2021 10:00:25 +0800 Guoqing Jiang <guoqing.jiang@xxxxxxxxx> wrote: > > @@ -281,6 +282,17 @@ static void linear_status (struct seq_file > > *seq, struct mddev *mddev) seq_printf(seq, " %dk rounding", > > mddev->chunk_sectors / 2); } > > > > +static void linear_error(struct mddev *mddev, struct md_rdev *rdev) > > +{ > > + char b[BDEVNAME_SIZE]; > > + > > + if (!test_and_set_bit(MD_BROKEN, &rdev->mddev->flags)) > > + pr_crit("md/linear%s: Disk failure on %s > > detected.\n" > > + "md/linear:%s: Cannot continue, failing > > array.\n", > > + mdname(mddev), bdevname(rdev->bdev, b), > > + mdname(mddev)); > > +} > > + > > Do you consider to use %pg to print block device? Will do. > > @@ -588,6 +589,17 @@ static void raid0_status(struct seq_file *seq, > > struct mddev *mddev) return; > > } > > > > +static void raid0_error(struct mddev *mddev, struct md_rdev *rdev) > > +{ > > + char b[BDEVNAME_SIZE]; > > + > > + if (!test_and_set_bit(MD_BROKEN, &rdev->mddev->flags)) > > + pr_crit("md/raid0%s: Disk failure on %s > > detected.\n" > > + "md/raid0:%s: Cannot continue, failing > > array.\n", > > + mdname(mddev), bdevname(rdev->bdev, b), > > + mdname(mddev)); > > +} > > + > > static void *raid0_takeover_raid45(struct mddev *mddev) > > { > > struct md_rdev *rdev; > > @@ -763,6 +775,7 @@ static struct md_personality raid0_personality= > > .size = raid0_size, > > .takeover = raid0_takeover, > > .quiesce = raid0_quiesce, > > + .error_handler = raid0_error, > > }; > > > > What is the advantage of adding error_handler for raid0 and linear? > IOW, without implement the error_handler, is there some existing > issue? > There is no issue. It was suggested by Song: https://lore.kernel.org/linux-raid/CAPhsuW4X94eJ8aG6i7F0zCmgjuWHSRWuBH2gOJjTe5uWg_rMvQ@xxxxxxxxxxxxxx/ Thanks, Mariusz