From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756802AbbCRVCi (ORCPT ); Wed, 18 Mar 2015 17:02:38 -0400 Received: from mailout.micron.com ([137.201.242.129]:41999 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756020AbbCRVCc (ORCPT ); Wed, 18 Mar 2015 17:02:32 -0400 Message-ID: <5509E8CB.8020404@micron.com> Date: Wed, 18 Mar 2015 14:06:19 -0700 From: Sam Bradshaw User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Red Hat/3.1.15-1.el6_1 Thunderbird/3.1.15 MIME-Version: 1.0 To: Jens Axboe CC: Subject: Re: [PATCH] blkmq: Fix NULL pointer deref when all reserved tags in use References: <5509E1D0.2080908@micron.com> <5509E2A8.5040905@kernel.dk> In-Reply-To: <5509E2A8.5040905@kernel.dk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-Product-Ver: SMEX-10.0.0.4152-7.000.1014-21408.002 X-TM-AS-Result: No--5.633600-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MT-CheckInternalSenderRule: True Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Good catch! But why not put the hctx == NULL check in as a conditional > in bt_get() before running the queue? I can't imagine other cases where > calling blk_mq_run_hw_queue() with hctx == NULL would be a valid scenario. The change was meant to be broad in scope. A runtime NULL deref is a rather unfortunate way to determine that there are other invalid scenarios. But given that both approaches fix the immediate problem, I'd be happy to change the patch as you suggest.