Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934451AbcJZXFt (ORCPT ); Wed, 26 Oct 2016 19:05:49 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:38409 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932469AbcJZXFm (ORCPT ); Wed, 26 Oct 2016 19:05:42 -0400 Subject: Re: bio linked list corruption. To: Linus Torvalds , Dave Jones , Chris Mason , Andy Lutomirski , Andy Lutomirski , Al Viro , Josef Bacik , David Sterba , linux-btrfs , Linux Kernel , Dave Chinner 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> From: Jens Axboe Message-ID: <2bdc068d-afd5-7a78-f334-26970c91aaca@fb.com> Date: Wed, 26 Oct 2016 17:03:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [66.29.164.166] X-ClientProxiedBy: CY1PR20CA0123.namprd20.prod.outlook.com (10.164.213.177) To MWHPR15MB1197.namprd15.prod.outlook.com (10.175.2.139) X-MS-Office365-Filtering-Correlation-Id: 0a256513-3fa3-44e5-eb64-08d3fdf4634e X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1197;2:oEiABoAjyNKADOH7urXHE/9F7Lt3o83297IcdmGt7gGWSeV9SP6sFY7nFpqQIbdCBMOeBeQZzQ4QE2PpwpanXaOfuXjQjgAv0D2GAFJ/CPaTEVL02XgO8P7Xafow8I2o8eRP3A73Fz8jKhuK6nO3xsn1LqbJuBgshJReJv8kTQqRx7sn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HPR15MB1197;31:A9IPSbP7cfp7bT/LoRUEi0SXalJ3XTjuda6VGJu7jZitpUpSTkyg8LDrVhXTphFHJC+sqXybYViFt15mioSOo4OsI1cejn2AAI5xw64NbWcKi5cXmBW5tUOEdbh/U5uOlLlFH1G2rN53MsIryPQ/mHUET4G3OrBtSE/opwY5waVToxwUzeISbJxZ4cprLn7Jv1Mzcqm6ywiI7iSBpXOGgGC3ZHvyAFuwnKOWL5GjH6RMkW3CkMTEiJ6F/aych1FywtaDHio7R/oUtPixFR7R3w==;20:IH37K2UqlRHinjNlwAHwx9f6JrTiCA8IIpfppyHLXaxCmEWQr5+OIxvhBTJdbbvglNIu0NCsaCVn2FRDhCgtlOjdVp8W06kl3cz1EBERuWcPvAf+DY4IHr/hDk8QWXJtGKVj1D2qqA1cPk/MGvubEBKDxL8ulNaYmglrRjYqw2k=;4:5JhvSWaKhc99j3WyGnuQIzZ8YN9GjEexn2Mgij9M37Hjj/JqmoE4jKK4vwj0H/C9SJNJJiEr7soTE1pHSeGWp2wL7R4w2IDAZMwKbguNr2kpHv5yWIZpzW+fGNpC0hUJeFQ5b8jm4SlK3tc0fQEYJc9qxdVL8lq73m9A/IloNAyqfcw/Yy9OrSmWouAJamZo1GYpxW0VzghiOS+YnSqlyez9sBRYitn3ZYSxPfn4r3FwwGMru0Tbn48+Gf7gD5oh9hA9kGpNvfi3y5WMuc2cxKmwtrMAYeHSyWIZLc/w/cJmQ7VrVGPNW5YbdbOkZS2FxQhwQo0EoDHzFnwaVz7aD1CEzn3CtbBT+fvg47Sj7XL2TAVMKrx07Di0mCrwQl5wmL4HqZKMJcObp28eUQRSvg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:MWHPR15MB1197;BCL:0;PCL:0;RULEID:;SRVR:MWHPR15MB1197; X-Forefront-PRVS: 0107098B6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(189002)(377454003)(199003)(24454002)(64126003)(5001770100001)(2950100002)(92566002)(93886004)(5660300001)(36756003)(6666003)(19580405001)(83506001)(19580395003)(8676002)(81166006)(305945005)(2906002)(117156001)(3480700004)(68736007)(7736002)(4001350100001)(31686004)(107886002)(47776003)(230700001)(23676002)(42186005)(81156014)(65806001)(106356001)(50986999)(76176999)(86362001)(105586002)(50466002)(33646002)(65956001)(54356999)(65826007)(31696002)(66066001)(586003)(6116002)(101416001)(3846002)(189998001)(97736004)(7846002)(77096005)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1197;H:[192.168.1.176];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjE1TUIxMTk3OzIzOllqWDQyWSt1aldZZFVXeU5NcUZYRHlrOEFh?= =?utf-8?B?S1VwRElUZGhCcDdENmpxUnRDSGdCelVaZ2ZlZDdMUlZSeWt1UEpiMFZReHpY?= =?utf-8?B?d2ExSzZwcy85ZVA0Y0cwZiswa2YxK1NjbTlONHZEN3FENmNGY2tKREVBTkFx?= =?utf-8?B?RjllTHY2bXhqc3lZM1V3VSs0ZmxtVmd3NHRvbHdTQ1I2S0NkWDdQQVJrM3Fr?= =?utf-8?B?VkZJS3dnbXdMZ2hZc1Ntb2U1U0V1dkxEdkVMbU5yOThGSXZZM2ozTHd0SnB4?= =?utf-8?B?NUpCWDhQNk84dS83UGk5YmNQTFpXMU8wdEY3NVBxZEVLQ0YvMXRpSUpsY0ZL?= =?utf-8?B?OUF0M1BHQlM5R0thb081MjVqQU5OcC84WHpGdFBmWTNySURQeHR2YU1xM1NJ?= =?utf-8?B?ckU5cXdHMDFmWkxDRmN5R05CZ0UyLzl0dEZjWjRzdStpTEJIbzAyWnB4K3gr?= =?utf-8?B?aElKazdOWlkyVU8rd2N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ItJKVoDaABWeHVZywt6NHAsch9Ed8/7RtWGmp1LuVn7p0Z+2NzT0FtluSWfdsrUN4uIrvFmoSrPCKD+zglUzRKLiqxy6wQ+f9AdQ0pzNcsNCHzqkVIDCHxg==;24:n5hDQ4JFrmM21fCcJZXF6UZ3Nw6CrcaOMMx9a6cU8cLe75nN4YFf2wWD79tBC9oblsuvY0UFKeUTEyoaOzrASbyymUAJ6NJCOW/dd5Od5iY=;7:nwcc4rQSOAeTR0gnbg2G5TzMUdXeScBIXVo9pJVnhKSyrR/e0YatRZ5ngyCPF0whftZNUM6ojb63tWhpTd+4HmHopIWWdqRzvON4rdhJ7nNwU/5FOIHiSsFLV4EBmCfU0mv3pub7QOw2RjniV3obn2YXe8RZt3fm53lw1tWCpb+3W+iU694R4LmD+NW3n9hfGUExs+wNPLbuRpgkQXzcIvxB7Y8OpM97ZCByuNJhZ6LbekrU3OWoRR8Y1a9vrTGtJLVSRWb0x0HyEZLTvrHpW7lOgs2kR6S1HfOmblarn4pO3lWVXXRuvewxrzBev3WL8PQY5aiTVqmDYd0HwYM15IjdbSA8M8LTadIttWC7CYY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1197;20:VUTfzjYoe5fRlkpJgYDIPhSsr916FYBZkoyr5WGna4/RsNJ3d4x8EY48sC838a24AXw5gNF9un98zVv3ZD9W3ZRYn6s2xEWZeNiuX+PFqix3O/zXAE8GrBny2obb5ksZGc761wgi5wiqUlWMojJEpDFTVEFHTq2CPORFY6N3/gU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2016 23:04:05.8256 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1197 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-26_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1244 Lines: 41 On 10/26/2016 04:58 PM, Linus Torvalds wrote: > On Wed, Oct 26, 2016 at 3:51 PM, Linus Torvalds > wrote: >> >> Dave: it might be a good idea to split that "WARN_ON_ONCE()" in >> blk_mq_merge_queue_io() into two > > I did that myself too, since Dave sees this during boot. > > But I'm not getting the warning ;( > > Dave gets it with ext4, and thats' what I have too, so I'm not sure > what the required trigger would be. Actually, I think I see what might trigger it. You are on nvme, iirc, and that has a deep queue. Dave, are you testing on a sata drive or something similar with a shallower queue depth? If we end up sleeping for a request, I think we could trigger data->ctx being different. Dave, can you hit the warnings with this? Totally untested... diff --git a/block/blk-mq.c b/block/blk-mq.c index ddc2eed64771..80a9c45a9235 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1217,9 +1217,7 @@ 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->queued++; return rq; } -- Jens Axboe