Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1264853ybv; Thu, 20 Feb 2020 16:42:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwR8pmbUtixi7zAD98LMofl0hVhNSEjs0nw46k6LOttqWDUUsv1u5bkq/gslZNCRaHXbdf1 X-Received: by 2002:a9d:7c9a:: with SMTP id q26mr27461941otn.206.1582245722350; Thu, 20 Feb 2020 16:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582245722; cv=none; d=google.com; s=arc-20160816; b=MjbhEYcphg6rRAhd/1cuyNjHSGq2VtDLaJa/Y9GC22Z2OnfHVxhFMKRxJ6UaEta7Ay ieilhWDcR4UCTLQnOcM2FIULuTZzs+ODuHWWqLkxDV8yWf1LXMO1zwWEyzl62TNiBF8u M8Sc12q9Mu1i0tK6OvDwr6AEtmXWHmxrJoVtrHJJWT6GyIKnWbROcH0DhoyiLtX/624r dGo1DDE5sPsif634Uu3trLz824AFh0oXdqt+Ykw2KNvIDYjlxZdeD7xVLTU7Yt68aDyo OwDM7zmpLfllea6KiBmElwl0t9a2t+0X64XkPJVLjKzPUsocaO8d08rMjAHNhPo90h/B CaEA== 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=t00kAymfauPSfXHXYHibGWIw+J5TRzJteBVALeoNvvI=; b=D4VQzS30kZTpyHlmT+dBYCIfisMsGzx70p1j8exmpPCjwwQYs9a5pXqpu0TraWGcYr 9yEDBCuMn8EEwnxDGwwJbHulioOnPytH87olppXCMNW24+tCMNSw6rzcW488M0CQnIxQ D08N63QOCiCpidIKrnCXBk0ImjRM1ccsMKw11wdGotbHSuVdw0Ismstj4Hy1vsok3MLF ZbfxScqVfEh3XOw8EPVwqePYmMjH/+fKf8O/0N3CS1aboKJq4VBTf71h3dJOaYuuVwd3 J7LGuwREOb9PR5vVd5fPnqMBNnwwyNygdLUavgts0IBxHnBwykMh2FFUNJzf90fbBiAf HVOg== 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; 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 j17si540813otl.278.2020.02.20.16.41.50; Thu, 20 Feb 2020 16:42:02 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729608AbgBUAln (ORCPT + 99 others); Thu, 20 Feb 2020 19:41:43 -0500 Received: from mga12.intel.com ([192.55.52.136]:30662 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729365AbgBUAll (ORCPT ); Thu, 20 Feb 2020 19:41:41 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:41:40 -0800 X-IronPort-AV: E=Sophos;i="5.70,466,1574150400"; d="scan'208";a="254656645" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:41:39 -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 V4 02/13] fs/xfs: Clarify lockdep dependency for xfs_isilocked() Date: Thu, 20 Feb 2020 16:41:23 -0800 Message-Id: <20200221004134.30599-3-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200221004134.30599-1-ira.weiny@intel.com> References: <20200221004134.30599-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 V3: Reordered to be a "pre-cleanup" patch 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