From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 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 7744EC2D0DB for ; Tue, 28 Jan 2020 16:42:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A6D32173E for ; Tue, 28 Jan 2020 16:42:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GVIfJ/uD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726182AbgA1QmI (ORCPT ); Tue, 28 Jan 2020 11:42:08 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:45326 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgA1QmI (ORCPT ); Tue, 28 Jan 2020 11:42:08 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00SGSWeu016772; Tue, 28 Jan 2020 16:42:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=Z8HiFTznMNVrEk75RYoFJvYIlA6i2GYiRwr5qK5XyIo=; b=GVIfJ/uDslaem3iS6K0GrSy0Rxcn/D+gxHve56MNtlY+FnhYBT4pX1Xtp0x1GVGY4yA8 Lt4s26MwquBmbN631cn8sMMgGX+kRKg19d6gmf06Bqx0kYzguYwfhUw+FRwQLQYgMfKp 8I1e9+E9gtutHMakPCusmu/YOWkWMZTfRVKdiQMRLhz2v3vUNRE9BaL2Hpw7MU0A60O+ EUPsYvdrSTgYbxV7JkhWUCrKzmkD35AhRbuRgK1vK/k6VpXLd2SgsrB06kvvvjMkysPW cY3palRtEk0CCDjg+/7weeMrEMgtdj9NT3CGlqfaY7BSoNFAtK/4GpnnrGD8CoXwUqJo EA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2xrdmqfkbk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Jan 2020 16:42:04 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00SGT9Fr037295; Tue, 28 Jan 2020 16:42:03 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2xta8j3ukp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Jan 2020 16:42:03 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00SGg13h004024; Tue, 28 Jan 2020 16:42:01 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Jan 2020 08:42:01 -0800 Date: Tue, 28 Jan 2020 08:42:00 -0800 From: "Darrick J. Wong" To: Pavel Reichl Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH 1/4] xfs: change xfs_isilocked() to always use lockdep() Message-ID: <20200128164200.GP3447196@magnolia> References: <20200128145528.2093039-1-preichl@redhat.com> <20200128145528.2093039-2-preichl@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200128145528.2093039-2-preichl@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9514 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=801 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001280128 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9514 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=868 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001280128 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Tue, Jan 28, 2020 at 03:55:25PM +0100, Pavel Reichl wrote: > mr_writer is obsolete and the information it contains is accesible > from mr_lock. > > Signed-off-by: Pavel Reichl > --- > fs/xfs/xfs_inode.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index c5077e6326c7..32fac6152dc3 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -352,13 +352,17 @@ xfs_isilocked( > { > if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) { > if (!(lock_flags & XFS_ILOCK_SHARED)) > - return !!ip->i_lock.mr_writer; > + return !debug_locks || > + lockdep_is_held_type(&ip->i_lock.mr_lock, 0); Why do we reference debug_locks here directly? It looks as though that variable exists to shut up lockdep assertions WARN_ONs, but xfs_isilocked is a predicate (and not itself an assertion), so why can't we 'return lockdep_is_held_type(...);' directly? (He says scowling at his own RVB in 6552321831dce). --D > return rwsem_is_locked(&ip->i_lock.mr_lock); > } > > if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) { > if (!(lock_flags & XFS_MMAPLOCK_SHARED)) > - return !!ip->i_mmaplock.mr_writer; > + return !debug_locks || > + lockdep_is_held_type( > + &ip->i_mmaplock.mr_lock, > + 0); > return rwsem_is_locked(&ip->i_mmaplock.mr_lock); > } > > -- > 2.24.1 >