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.5 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 94BA1C4CEC7 for ; Sat, 14 Sep 2019 17:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 675A820854 for ; Sat, 14 Sep 2019 17:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbfINRBw (ORCPT ); Sat, 14 Sep 2019 13:01:52 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58562 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfINRBw (ORCPT ); Sat, 14 Sep 2019 13:01:52 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9BQg-0003Wa-MJ; Sat, 14 Sep 2019 17:01:46 +0000 Date: Sat, 14 Sep 2019 18:01:46 +0100 From: Al Viro To: Linus Torvalds Cc: "zhengbin (A)" , 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: <20190914170146.GT1131@ZenIV.linux.org.uk> References: <20190903154007.GJ1131@ZenIV.linux.org.uk> <20190903154114.GK1131@ZenIV.linux.org.uk> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Sep 14, 2019 at 09:49:21AM -0700, Linus Torvalds wrote: > On Sat, Sep 14, 2019 at 9:16 AM Al Viro wrote: > > > > OK, folks, could you try the following? It survives the local beating > > so far. > > This looks like the right solution to me. Keep the locking simple, > take the dentry refcount as long as we keep a ref to it in "*res". > > However, the one thing that strikes me is that it looks to me like > this means that the "cursor" and the dentry in "*res" are basically > synonymous. Could we drop the cursor entirely, and just keep the ref > to the last dentry we showd _as_ the cursor? I thought of that, but AFAICS rename(2) is a fatal problem for such a scheme.