Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp379368pxb; Mon, 13 Sep 2021 22:37:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNYrBcvizYpAIx30Bfr7aLZXLxzk+q4NajlmUfn7vzGzkLgL0/rh+uHUWVMvxYJD4yEyDy X-Received: by 2002:a02:19c9:: with SMTP id b192mr11599293jab.67.1631597823133; Mon, 13 Sep 2021 22:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631597823; cv=none; d=google.com; s=arc-20160816; b=HV9stpxm2dc9+PfliiiAfEJUkkLNRELaRNAABm1wLb9GjLRUU3MwKYblo5airHxW0g ncay/JY9JqGk3jVXQzOAUeAUaLEk0PLC3N4+wLIMBRwOY36/vjYuPs2k7ktdoLs7k7m1 LXQByFDbT1dV5Nc3qJgU5+eazxa0swdZVVMeUC/UAZFVsYx74mi8GnZnDajs7z/S/dhq HH+s/P9qxOGTjSY1S6h+bY08xbv/mwupG547N0RltysNSn8x7u2//Ie+Slm7MdYAkFab Q9T2ziCaE6xo8YEYKbE0FyXBPlyQrYaZdgoFUQru67wPwF5JuScgWA/KHDZMxx6D0qVJ KjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=0a/VnN2wn6kf3CRj3bkdHFe/CL4cRuLtEaRPbeckjQ4=; b=KYrBJkWFsYvyswLqrn0Q6fowGgBMKmaMUMXKn8EKvhdFcfcN7nWVDBhXOJZrNBMbd3 dce4RmM8ZNb/RbFMx4e63PGVyVzmUthEPvK7DtXKOW4hZTnQ+Pg79zLMa2Seuzb0FUGQ pgsaZkl9bpwd++8b8ppDAO7Ex01KHGN1cviG6OmAF3P4dYkh2UbeRRPsmg+j3HQhjgXk 7vwv6C/b28AeYg0mTlWZpsfYg31QjI3CpjAQyq4nTZWnOHGb36LTYr+PEa2fv+OR7YE3 qVWwp1EPShDJtPK+8gczNgMWxBxrLxFpqwvHq2h4ZCV1A/uz2l4uB7WKzUJxCYe0db22 9Xxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KsjLS31A; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si9561730iow.4.2021.09.13.22.36.46; Mon, 13 Sep 2021 22:37:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KsjLS31A; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239595AbhINFhJ (ORCPT + 99 others); Tue, 14 Sep 2021 01:37:09 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:33434 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237341AbhINFhH (ORCPT ); Tue, 14 Sep 2021 01:37:07 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6BECD1FDCA; Tue, 14 Sep 2021 05:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1631597749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0a/VnN2wn6kf3CRj3bkdHFe/CL4cRuLtEaRPbeckjQ4=; b=KsjLS31ATYXTnlL4QvHJ/ThAcNB3xoCMosE6QzcP1t2e/HO1CIEPaJjmzqWoSPkbgBqTpA p5xUfuwKGf2WFjNgkGEsT2ZcadRYw34yjsCGSHV6IiB6nrVaZSVKWJ7fTJAmkMU9nsQSXJ dkiBtoEnOTeSQNBYhcrxvOFwcwhZyuk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1631597749; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0a/VnN2wn6kf3CRj3bkdHFe/CL4cRuLtEaRPbeckjQ4=; b=FKOY6uS0FUh60q5rvrz+RVtV1Rb1Oika+KRaosu8ykFoYfSekYTiv6+Qw0GMPGV7n/xeWe oefhygvPfR60ddDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2244F13E4A; Tue, 14 Sep 2021 05:35:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iZ5EArU0QGEOTwAAMHmgww (envelope-from ); Tue, 14 Sep 2021 05:35:48 +0000 Subject: Re: [PATCH RESEND v3 01/13] blk-mq: Change rqs check in blk_mq_free_rqs() To: John Garry , axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, ming.lei@redhat.com, linux-scsi@vger.kernel.org References: <1631545950-56586-1-git-send-email-john.garry@huawei.com> <1631545950-56586-2-git-send-email-john.garry@huawei.com> From: Hannes Reinecke Message-ID: <7a75a9e0-5467-e4fa-d059-8154f5568854@suse.de> Date: Tue, 14 Sep 2021 07:35:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <1631545950-56586-2-git-send-email-john.garry@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/21 5:12 PM, John Garry wrote: > The original code in commit 24d2f90309b23 ("blk-mq: split out tag > initialization, support shared tags") would check tags->rqs is non-NULL and > then dereference tags->rqs[]. > > Then in commit 2af8cbe30531 ("blk-mq: split tag ->rqs[] into two"), we > started to dereference tags->static_rqs[], but continued to check non-NULL > tags->rqs. > > Check tags->static_rqs as non-NULL instead, which is more logical. > > Signed-off-by: John Garry > Reviewed-by: Ming Lei > --- > block/blk-mq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 108a352051be..2316ff27c1f5 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -2340,7 +2340,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, > { > struct page *page; > > - if (tags->rqs && set->ops->exit_request) { > + if (tags->static_rqs && set->ops->exit_request) { > int i; > > for (i = 0; i < tags->nr_tags; i++) { > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer