From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:34020 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934068AbcJZXV0 (ORCPT ); Wed, 26 Oct 2016 19:21:26 -0400 Subject: Re: bio linked list corruption. To: Linus Torvalds References: <20161026002752.qvrm6yxqb54fiqnd@codemonkey.org.uk> <20161026163018.wx57yy554576s6e2@codemonkey.org.uk> <20161026184201.6ofblkd3j5uxystq@codemonkey.org.uk> <488f9edc-6a1c-2c68-0d33-d3aa32ece9a4@fb.com> <20161026224025.mou27kki4bslftli@codemonkey.org.uk> <2bdc068d-afd5-7a78-f334-26970c91aaca@fb.com> CC: Dave Jones , Chris Mason , "Andy Lutomirski" , Andy Lutomirski , Al Viro , Josef Bacik , David Sterba , linux-btrfs , Linux Kernel , Dave Chinner From: Jens Axboe Message-ID: <203e0319-bc9b-245c-e162-709267540d22@fb.com> Date: Wed, 26 Oct 2016 17:20:01 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 10/26/2016 05:08 PM, Linus Torvalds wrote: > On Wed, Oct 26, 2016 at 4:03 PM, Jens Axboe wrote: >> >> Actually, I think I see what might trigger it. You are on nvme, iirc, >> and that has a deep queue. > > Yes. I have long since moved on from slow disks, so all my systems are > not just flash, but m.2 nvme ssd's. > > So at least that could explain why Dave sees it at bootup but I don't. Yep, you'd never sleep during normal boot. The original patch had a problem, though... This one should be better. Too many 'data's, we'll still need to assign ctx/hctx, we should just use the current ones, not the original ones. diff --git a/block/blk-mq.c b/block/blk-mq.c index ddc2eed64771..e56fec187ba6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1217,9 +1224,9 @@ static struct request *blk_mq_map_request(struct request_queue *q, blk_mq_set_alloc_data(&alloc_data, q, 0, ctx, hctx); rq = __blk_mq_alloc_request(&alloc_data, op, op_flags); - hctx->queued++; - data->hctx = hctx; - data->ctx = ctx; + data->hctx = alloc_data.hctx; + data->ctx = alloc_data.ctx; + data->hctx->queued++; return rq; } -- Jens Axboe