On Mon, 13 Aug 2012 10:04:54 +0800 Shaohua Li <shli@xxxxxxxxxx> wrote: > On Mon, Aug 13, 2012 at 11:50:51AM +1000, NeilBrown wrote: > > On Fri, 10 Aug 2012 10:51:19 +0800 Shaohua Li <shli@xxxxxxxxxxxx> wrote: > > > > > @@ -4094,6 +4159,19 @@ static void make_request(struct mddev *m > > > bi->bi_next = NULL; > > > bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ > > > > > > + /* block layer doesn't correctly do alignment even we set correct alignment */ > > > + if (unlikely(bi->bi_rw & REQ_DISCARD)) { > > > + int stripe_sectors = conf->chunk_sectors * > > > + (conf->raid_disks - conf->max_degraded); > > > > This isn't right when an array is being reshaped. > > I suspect that during a reshape we should only attempt DISCARD on the part of > > the array which has already been reshaped. On the other section we can > > either fail the discard (is that a good idea?) or write zeros. > > I had a check in below for-loop for reshape, is it enough? If not, I'd like > just ignore discard request for reshape. We force discard_zero_data to be 0, so > should be ok. Yes, you are right - that is sufficient. I hadn't read it properly. > > I'll fix other two issues. Will repost the raid5 discard patches later. thanks, NeilBrown
Attachment:
signature.asc
Description: PGP signature