Received: by 10.192.165.156 with SMTP id m28csp224824imm; Tue, 17 Apr 2018 09:06:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx48B4VfBB8VaAdjzri8EyCsh1AcQWdp2R506GDMJXtg2gVAhflXY2ILt8TxPZlR+97Ezj0IG X-Received: by 2002:a17:902:71cc:: with SMTP id t12-v6mr2636298plm.247.1523981181497; Tue, 17 Apr 2018 09:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981181; cv=none; d=google.com; s=arc-20160816; b=TB5rXkGm51Uv+cBPodc33W1RYLM8dFnpa62tZdHvoJAKx+iyXsmHXfFSqpmivai8Ds eJg2SQ44DB+fgLvZNQvLYBus0QndLLMFGK2fekJUrqvAnX0cSp3LVR2VAM4/vpIad1E6 lA+UZncFKNLCi1TCPQvI5QCCPbaQbZpcwWHMt+bRq5m5YgL/3d9Jwu3H8c6t5U4h6Xna FwvYDk7FPlN7oM8TRDRcdYToSAHuuK2KwR6jJS6wzfBwwVW1c2eeLFZKU7gW7Nggjqvp H/oy6vOqPJCquil858oSrOB6FIM0c8Qr6vuL0rlfkpw2wB5JhKYEZVBkhmoOnqZVFszn xHag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MMGiR3xO3Z7g6xX3cQ6iNhZ2c6nrkn8O8HDNeaS+z70=; b=Kn64zRjjMgnSMP5Bl4USucu58pHYqb91FeRb5TN2dI/YfgH1xIK0vf7Da3cPAdtHYp gM6RMS95ROldyQMsZ8T1pwPTlphXLqnDeUzUkrlv0n19oGKv0YOGY12PgpRn8Pi+RHc6 ij9r5+40zeA++WDtHaq9cwmTMd28T88sKq4dq8TZ0+IeLBWhq40+C5hJGGCTmfdu3G89 b6/XLMQGGERTHpFE7RocDcOvxNEPx6w2mxmn8byoprvQuCjp+hhZDth134To8H3IVFi6 OWRH5ZodUqDDzHeKKTphioPmK+SHknKHNKQ0H1HI7YX4Ia9ZkbaEAb9iCW+gooCSlaAy z8Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si14857624pld.2.2018.04.17.09.06.07; Tue, 17 Apr 2018 09:06:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754490AbeDQQEd (ORCPT + 99 others); Tue, 17 Apr 2018 12:04:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33966 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbeDQQEc (ORCPT ); Tue, 17 Apr 2018 12:04:32 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D15CDF59; Tue, 17 Apr 2018 16:04:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tejun Heo , Bart Van Assche , Hannes Reinecke , Ming Lei , Christoph Hellwig , Johannes Thumshirn , Oleksandr Natalenko , Martin Steigerwald , Jens Axboe Subject: [PATCH 4.15 28/53] block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}() Date: Tue, 17 Apr 2018 17:58:53 +0200 Message-Id: <20180417155724.531278623@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155723.091120060@linuxfoundation.org> References: <20180417155723.091120060@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit 818e0fa293ca836eba515615c64680ea916fd7cd upstream. scsi_device_quiesce() uses synchronize_rcu() to guarantee that the effect of blk_set_preempt_only() will be visible for percpu_ref_tryget() calls that occur after the queue unfreeze by using the approach explained in https://lwn.net/Articles/573497/. The rcu read lock and unlock calls in blk_queue_enter() form a pair with the synchronize_rcu() call in scsi_device_quiesce(). Both scsi_device_quiesce() and blk_queue_enter() must either use regular RCU or RCU-sched. Since neither the RCU-protected code in blk_queue_enter() nor blk_queue_usage_counter_release() sleeps, regular RCU protection is sufficient. Note: scsi_device_quiesce() does not have to be modified since it already uses synchronize_rcu(). Reported-by: Tejun Heo Fixes: 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") Signed-off-by: Bart Van Assche Acked-by: Tejun Heo Cc: Tejun Heo Cc: Hannes Reinecke Cc: Ming Lei Cc: Christoph Hellwig Cc: Johannes Thumshirn Cc: Oleksandr Natalenko Cc: Martin Steigerwald Cc: stable@vger.kernel.org # v4.15 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/block/blk-core.c +++ b/block/blk-core.c @@ -823,7 +823,7 @@ int blk_queue_enter(struct request_queue bool success = false; int ret; - rcu_read_lock_sched(); + rcu_read_lock(); if (percpu_ref_tryget_live(&q->q_usage_counter)) { /* * The code that sets the PREEMPT_ONLY flag is @@ -836,7 +836,7 @@ int blk_queue_enter(struct request_queue percpu_ref_put(&q->q_usage_counter); } } - rcu_read_unlock_sched(); + rcu_read_unlock(); if (success) return 0;