Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2976625ybb; Sun, 5 Apr 2020 22:36:52 -0700 (PDT) X-Google-Smtp-Source: APiQypKCJZNXZI0SiOQ/7vjoV3kDZaq2sTQK4iMmtjzIc12RERBJh5n5KWHWbO3NCy2XE63l5XxO X-Received: by 2002:a9d:17ec:: with SMTP id j99mr15875733otj.213.1586151411864; Sun, 05 Apr 2020 22:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586151411; cv=none; d=google.com; s=arc-20160816; b=U5YKZakrhHDxIYNXfUhaCxVmuYwx2eAVeKZqmGe64Oejn6qDsnWttuMCP9g+50TOdi nb0/YSNSs/Nxm4DNT0XAsSAINC0zeN/osCV6iimX9VgSmBeiut7OxVSUK85kMaSe6PyX /geSzL24Ob7myKiJnSd2HZ1qY+xkgluB6yRHwwbJf76x+4FS3hLWDmPNDxIhCphL2+m6 UG9Wyp131Twd110RyELDDOwwwMwCBBP2Dqw72clo/nhwDWG+veAPdO7Ho1Em8ObbMrpp +Db8ugYMh9CSfyPYSfEVwfkGBngwSO5q6jnppS73VLHNm4U6qnp82ao9hfk7XwS7vUfh ucQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :references:in-reply-to:cc:to:subject:from:dkim-signature; bh=CU2Yugo0GP8rSA0D5+20VRTazpR4K/wfY10bxf3KXLw=; b=TM2Y8qdYRS4UnsV0J6+NcR4Gx7fNesOXFh6m9Wl5j/ylRE55uueBOVLRibUUWQderT bpMttDpKZXADtxyAF6ISgjf6RyUf2CUM36ThfOm/xYrhZ8jpk+9bFSp38J76Ts0unueI Hi3XFlbh/aGY+1v/Zefqh5qX2B4WXfPiSd4XyWMqeyRPFswh+1AT28iQ2qGnqqqPJKnz aQP90fBP7SpJbylkDLY9koPlsYj7ObZGTtU+MCGQ1zr03EuUueRXMxGQaI+5DKeRWiH2 EfZ4GdFaOyH7HV80oCYuop/5+uupYJP4H0ikYiQFiykYx/q50B2lQIhhRO9XPAVFXAvk OoQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hRQaQFHE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h145si6916198oib.210.2020.04.05.22.36.25; Sun, 05 Apr 2020 22:36:51 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hRQaQFHE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbgDFFgU (ORCPT + 99 others); Mon, 6 Apr 2020 01:36:20 -0400 Received: from mail-pj1-f66.google.com ([209.85.216.66]:50274 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbgDFFgU (ORCPT ); Mon, 6 Apr 2020 01:36:20 -0400 Received: by mail-pj1-f66.google.com with SMTP id v13so6029913pjb.0 for ; Sun, 05 Apr 2020 22:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:in-reply-to:references:mime-version:content-id :date:message-id; bh=CU2Yugo0GP8rSA0D5+20VRTazpR4K/wfY10bxf3KXLw=; b=hRQaQFHE+WlG2EzQzvmED2YHfJET0RivmAJuzcP3p79AtKyNaw2X5fE4Gd5P0WK9hx xaCP8fh9TupXUJ61aOjLrjy+y2i+pjQipVZKhxRhc0Hb4jlAuCi2S0KqISu2I8WOYSO+ icpXXqWPcdZZhNyVhADptpk80fnWsdzOfOYqv4Bt/096sG1bnQtixR8fwS1EvJEZbTYG 0j00Sh6yX6B3hFPR425jajfho7PlPbKgQy6l1EV3amqOv2Rl1UO4yAfzhQItV36ykNR7 4JVDYL8Ix0P5yoxNao7BjmXguJjEq9l6raHQ+mqOWQrlHVCxrrPlcTr3PWiFDZwFI7pv /HVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:in-reply-to:references :mime-version:content-id:date:message-id; bh=CU2Yugo0GP8rSA0D5+20VRTazpR4K/wfY10bxf3KXLw=; b=dkNNM7AqGnkn9Deno7SNb0uXhv58HtbIeh3bQ05hwX4sYj7OEhUAKo019Yd1PnMoCg l5vKnpSQS0/JHmKpbiWFNmJSfPaV9KN9pHEW6meSnJ7Vf2sECaiBu/j4KYwg+k/LJaVy EZb/8vWDpobxePbqO4O7QehvYxHdMq2+OSnsjKD5eu6OuAjYXQRPmHQIEeUbJoHCpLvA Wh3hI8IaHCR15VsS/IP6x1sYULaJ3XGfDIZd9UkJQvHCz4NDhGRwK0+oOWi9khx/Vpqc SVWNYb7WLbbktwlWFeH5HadGGu2wtORy9nsJNm31nt+D8vmBuBOFc/9eejKOIdek7YHf jytQ== X-Gm-Message-State: AGi0PuZI6gMZdjXELxkRQPFMGM4C8HQ7dJDhlH9KbEbYL0QGaaaQ5ua0 sD2AxzPeyTPLRkvAOaAT0L8= X-Received: by 2002:a17:902:7896:: with SMTP id q22mr17123097pll.75.1586151378924; Sun, 05 Apr 2020 22:36:18 -0700 (PDT) Received: from jromail.nowhere (h219-110-108-104.catv02.itscom.jp. [219.110.108.104]) by smtp.gmail.com with ESMTPSA id e187sm10690233pfe.50.2020.04.05.22.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 22:36:18 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=jrobl) by jrobl id 1jLKQj-0007xb-1W ; Mon, 06 Apr 2020 14:36:17 +0900 From: "J. R. Okajima" Subject: Re: [PATCH v2] ext2: Silence lockdep warning about reclaim under xattr_sem To: Jan Kara Cc: linux-ext4@vger.kernel.org In-Reply-To: <20200225120803.7901-1-jack@suse.cz> References: <20200225120803.7901-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30601.1586151377.1@jrobl> Date: Mon, 06 Apr 2020 14:36:17 +0900 Message-ID: <30602.1586151377@jrobl> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Jan Kara: > Lockdep complains about a chain: > sb_internal#2 --> &ei->xattr_sem#2 --> fs_reclaim > > and shrink_dentry_list -> ext2_evict_inode -> ext2_xattr_delete_inode -> > down_write(ei->xattr_sem) creating a locking cycle in the reclaim path. > This is however a false positive because when we are in > ext2_evict_inode() we are the only holder of the inode reference and > nobody else should touch xattr_sem of that inode. So we cannot ever > block on acquiring the xattr_sem in the reclaim path. > > Silence the lockdep warning by using down_write_trylock() in > ext2_xattr_delete_inode() to not create false locking dependency. v5.6 is released. But I cannot see this patch applied. Sad. Anyway I am wondering whether acquiring xattr_sem in ext2_xattr_delete_inode() is really necessary or not. It is necessary because this function refers and clears i_file_acl, right? But this function handles the removed (nlink==0) and unused inodes only. If nobody else touches xattr_sem as you wrote, then it is same to i_file_acl, isn't it? Can we replace xattr_sem (only here) by memory barrier, or remove xattr_sem from ext2_xattr_delete_inode()? J. R. Okajima