Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2030210ybv; Sat, 8 Feb 2020 11:36:38 -0800 (PST) X-Google-Smtp-Source: APXvYqznNgPITbDtQCisrJTREVC7OBgE2nPS/2mLQbWL+GllYVk5hNr2YES1I2ED+A89vDihEKew X-Received: by 2002:a9d:5784:: with SMTP id q4mr4579914oth.278.1581190598024; Sat, 08 Feb 2020 11:36:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581190598; cv=none; d=google.com; s=arc-20160816; b=X1Z4+8dpKH1/WA5fz+6ZxwuqD77re9yTUth7sg+763xrJCXtAujlExgvtHmTi9zpkf 9qSqccLpAUjFxjbtZZ+IEY3WyXy3XoPy7tWZ1aLUcu84pMGxi0r3VEtkrYl9aZaGogLD 7RPrbSs4QJflRtD6kuIyUx+xLtRBwdoohhlxlfUVGisTZXRaTQjRS+W8Td9eUa4b8AvE R0Z492NkzMKbwqAY0bFeQnvkGOu+rtwS+T8Ys1K3jhWoCzfZ94mMWfuFf1RbxPaPjTHW 665cgO7AGCCZAZk4r0cEYTTILhGbowOJBYc23SxtkmP3yEQVsW9xPVYe5L5zeu9YV7HR IURA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tj7BTtQlar2j7OYhE7Yox0Vu5kjnci+evlA5omTcHsg=; b=LNUtxnX47Pnd5701+oZhAqNxdWB8KHp4MPkRj7/10ZI/d6w+E3R5KgYuRTwH44MYOw Iu/ADdMeUv7BWBdEUaIbq64Br/IIgQLODzDq8CRMsmV340fmuufgWCZucxQEreWNORzw 6rJX6CSubWldQZCu6GbZI3JVALFVXiBF8Snl4261Vt+V9InRntrOxfKmm5tsqYswIyKh QRsTVNa52tTwW66M86oyjTrolzzztAkhh7G9LOrWq9nIi7DSAae2YFoNuXbVeq8nI1hU TPNNNHwVtVIzMDF8fVEOwdyLoEH0HCwJXPGtcZavo5o/X+y2VcmwxnwL8nBWmUPmW9PN 7J7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si2110543otk.324.2020.02.08.11.36.27; Sat, 08 Feb 2020 11:36:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbgBHTfe (ORCPT + 99 others); Sat, 8 Feb 2020 14:35:34 -0500 Received: from mga01.intel.com ([192.55.52.88]:59763 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727587AbgBHTev (ORCPT ); Sat, 8 Feb 2020 14:34:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2020 11:34:51 -0800 X-IronPort-AV: E=Sophos;i="5.70,418,1574150400"; d="scan'208";a="280279360" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2020 11:34:51 -0800 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org Cc: Ira Weiny , Alexander Viro , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v3 08/12] fs/xfs: Clarify lockdep dependency for xfs_isilocked() Date: Sat, 8 Feb 2020 11:34:41 -0800 Message-Id: <20200208193445.27421-9-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200208193445.27421-1-ira.weiny@intel.com> References: <20200208193445.27421-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Ira Weiny xfs_isilocked() can't work fully without CONFIG_LOCKDEP. However, making xfs_isilocked() dependant on CONFIG_LOCKDEP is not feasible because it is used for more than the i_rwsem. Therefore a short-circuit was provided via debug_locks. However, this caused confusion while working through the xfs locking. Rather than use debug_locks as a flag specify this clearly using IS_ENABLED(CONFIG_LOCKDEP). Signed-off-by: Ira Weiny --- Changes from V2: This patch is new for V3 fs/xfs/xfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c5077e6326c7..35df324875db 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -364,7 +364,7 @@ xfs_isilocked( if (lock_flags & (XFS_IOLOCK_EXCL|XFS_IOLOCK_SHARED)) { if (!(lock_flags & XFS_IOLOCK_SHARED)) - return !debug_locks || + return !IS_ENABLED(CONFIG_LOCKDEP) || lockdep_is_held_type(&VFS_I(ip)->i_rwsem, 0); return rwsem_is_locked(&VFS_I(ip)->i_rwsem); } -- 2.21.0