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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 3BF75C4740C for ; Mon, 23 Sep 2019 05:09:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C3F520882 for ; Mon, 23 Sep 2019 05:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389288AbfIWFJD (ORCPT ); Mon, 23 Sep 2019 01:09:03 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54090 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389251AbfIWFJC (ORCPT ); Mon, 23 Sep 2019 01:09:02 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCGao-0005uD-Jw; Mon, 23 Sep 2019 05:08:58 +0000 Date: Mon, 23 Sep 2019 06:08:58 +0100 From: Al Viro To: "zhengbin (A)" Cc: Linus Torvalds , Jan Kara , Andrew Morton , linux-fsdevel , "zhangyi (F)" , renxudong1@huawei.com, Hou Tao Subject: Re: [PATCH] Re: Possible FS race condition between iterate_dir and d_alloc_parallel Message-ID: <20190923050858.GB26530@ZenIV.linux.org.uk> References: <20190909145910.GG1131@ZenIV.linux.org.uk> <14888449-3300-756c-2029-8e494b59348b@huawei.com> <7e32cda5-dc89-719d-9651-cf2bd06ae728@huawei.com> <20190910215357.GH1131@ZenIV.linux.org.uk> <20190914161622.GS1131@ZenIV.linux.org.uk> <20190922212934.GC29065@ZenIV.linux.org.uk> <0848b6c7-386c-21fb-233f-be8d9965fbf7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0848b6c7-386c-21fb-233f-be8d9965fbf7@huawei.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Sep 23, 2019 at 11:32:43AM +0800, zhengbin (A) wrote: > > Is it possible to trigger ABBA deadlock? In next_positive, the lock order is (parent, dentry), > > while in dput, the lock order is (dentry, parent). Cause we use spin_trylock(parent), so the ABBA deadlock will not open. > > dput > >     fast_dput > >        spin_lock(&dentry->d_lock) > >    dentry_kill > >        spin_trylock(&parent->d_lock)) > > Is there any other scene like dput, but do not use spin_trylock? I am looking for the code, till now do not find this There should be none. The order is parent, then child. And all changes of the tree topology are serialized by rename_lock.