From patchwork Fri Jan 24 09:28:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2FA1C2D0DB for ; Fri, 24 Jan 2020 11:19:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B785E2077C for ; Fri, 24 Jan 2020 11:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864741; bh=jchwoRYGdw5u05s9Q3W2XMDv3EKFMsWmDZcOvPvSGSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zV1GF/hz9YyZkNt62BkajDQSGMr7G7nyUhE3D/z9E7PFE255jJk6c+2xA4m5JXPbD BSttptOltyWtzVTpSKTg4agirkIg7FHnCqadKoIsHydJlxSFXA3MipUj5/z/WVkfHP 1ImSLWx8cvF76N3XVsHW7VkRHzVR7T5NVbl3EZ9I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390733AbgAXLS7 (ORCPT ); Fri, 24 Jan 2020 06:18:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390732AbgAXLS7 (ORCPT ); Fri, 24 Jan 2020 06:18:59 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 629912077C; Fri, 24 Jan 2020 11:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864739; bh=jchwoRYGdw5u05s9Q3W2XMDv3EKFMsWmDZcOvPvSGSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=agdUuy5q2pX/mUu8fM9AxUHneS97zZzf1n4k21Z8piCHKK/9KSRNnxb1errLN6SBw ELuaZoy6UOhoKGQYpAOZUfElDtpgtsHziR63niIWBy8pMvvBopn4FcJhKTQ5d811u9 EHrFk1adFx9Nd+ZofqTbQjIfJcqnx9y1qEfofHgg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Igor Konopko , =?utf-8?q?Javier_Gonz=C3=A1lez?= , Hans Holmberg , =?utf-8?q?Matias_Bj=C3=B8r?= =?utf-8?q?ling?= , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 352/639] lightnvm: pblk: fix lock order in pblk_rb_tear_down_check Date: Fri, 24 Jan 2020 10:28:42 +0100 Message-Id: <20200124093131.204616416@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Igor Konopko [ Upstream commit 486b5aac85f6ec0b2df3e82a6a629d5eb7804db5 ] In pblk_rb_tear_down_check() the spinlock functions are not called in proper order. Fixes: a4bd217 ("lightnvm: physical block device (pblk) target") Signed-off-by: Igor Konopko Reviewed-by: Javier González Reviewed-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/lightnvm/pblk-rb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c index f6eec0212dfcf..d22c13b556221 100644 --- a/drivers/lightnvm/pblk-rb.c +++ b/drivers/lightnvm/pblk-rb.c @@ -784,8 +784,8 @@ int pblk_rb_tear_down_check(struct pblk_rb *rb) } out: - spin_unlock(&rb->w_lock); spin_unlock_irq(&rb->s_lock); + spin_unlock(&rb->w_lock); return ret; }