On 11/30/18 9:38 AM, Ming Lei wrote: > There are actually two kinds of discard merge: > > - one is the normal discard merge, just like normal read/write request, > and call it single-range discard > > - another is the multi-range discard, queue_max_discard_segments(rq->q) > 1 > > For the former case, queue_max_discard_segments(rq->q) is 1, and we > should handle this kind of discard merge like the normal read/write > request. > > This patch fixes the following kernel panic issue[1], which is caused by > not removing the single-range discard request from elevator queue. > > Guangwu has one raid discard test case, in which this issue is a bit > easier to trigger, and I verified that this patch can fix the kernel > panic issue in Guangwu's test case. Yikes, good catch! Applied for 4.20. -- Jens Axboe