Re: [patch 6/7 v2] MD: raid5 trim support
flat view
From: Shaohua Li <shli@kernel.org>
Date: 2012-08-13 02:04:54
On Mon, Aug 13, 2012 at 11:50:51AM +1000, NeilBrown wrote:
On Fri, 10 Aug 2012 10:51:19 +0800 Shaohua Li [off-list ref] wrote:quoted
@@ -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. I'll fix other two issues. Will repost the raid5 discard patches later. Thanks, Shaohua