From patchwork Thu Feb 4 13:57:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8221921 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 287B9BEEE5 for ; Thu, 4 Feb 2016 13:59:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D11A200E3 for ; Thu, 4 Feb 2016 13:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E56E20375 for ; Thu, 4 Feb 2016 13:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbcBDN7k (ORCPT ); Thu, 4 Feb 2016 08:59:40 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36723 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757033AbcBDN62 (ORCPT ); Thu, 4 Feb 2016 08:58:28 -0500 Received: by mail-wm0-f43.google.com with SMTP id p63so213046781wmp.1 for ; Thu, 04 Feb 2016 05:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=X0jnupG0FxK335+RAuSeJCapZAEO/2gWf1REirBOxoo=; b=lrf8B0xX3Edany/g7AxAxYWGaSC0MrCaVNwkmFpahP4WzTp4Gv1i/OCC9wQOKFwaac av69R1jtW1BIa6Y9Oho3z8IXZSDaJOnGb/ZJbp3OWnycATKFbaD4ZaTBVxUIG9l7Ao+0 LgvdNlZXt8K+5Zd1rzIwhwahsAvZEkkkox41g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=X0jnupG0FxK335+RAuSeJCapZAEO/2gWf1REirBOxoo=; b=mBhYXT+DFfxo1r46o7MBnHC2iNn178ifYJG7EGOxcUa1e/w1JZvZzz0kb9FYyKw5Mu xNYauvvdWgruOl89ndYzPGcgSXbp24T8Qy0XsMWCtMIzQqFsOMd4NE7M2XxyZglrmyOa 7aBhCORihcnvkhFgrjZw2gM2znsqnfta6PofhLdK8pU6sYrtnAxtxc2Qetz6C+mamIFq 6WNK9vn7u88h30aErKOJpmHuByYF0gWJvevvK6o5o52WT+IEURFV1jmDrNNX0uWG3Vr5 WnChLPghAPQn8xFOfc17bzEu/BS8sC9UCeQeuFEZAwU0qewfEn7l6KZNYZeZVyUyeN5h 42EA== X-Gm-Message-State: AG10YORiByu6+PGtI36vRau5/pBUBVzFfo+PuNwBZts+pnFQNg/5CzTv1YwTJI0KHgKkng== X-Received: by 10.28.15.210 with SMTP id 201mr29081939wmp.79.1454594307538; Thu, 04 Feb 2016 05:58:27 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id l194sm26656734wmb.14.2016.02.04.05.58.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 05:58:26 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 2/5] lightnvm: warn if irqs are disabled in lock laddr Date: Thu, 4 Feb 2016 14:57:05 +0100 Message-Id: <1454594228-18970-3-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454594228-18970-1-git-send-email-m@bjorling.me> References: <1454594228-18970-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González Add a warning if irqs are disabled when locking a new address in rrpc. The typical path to a new request does not disable irqs, but this is not guaranteed in the future. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h index dfca5c4..c27283a 100644 --- a/drivers/lightnvm/rrpc.h +++ b/drivers/lightnvm/rrpc.h @@ -184,6 +184,8 @@ static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr, sector_t laddr_end = laddr + pages - 1; struct rrpc_inflight_rq *rtmp; + WARN_ON(irqs_disabled()); + spin_lock_irq(&rrpc->inflights.lock); list_for_each_entry(rtmp, &rrpc->inflights.reqs, list) { if (unlikely(request_intersects(rtmp, laddr, laddr_end))) {