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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 92471C4CEC7 for ; Sun, 15 Sep 2019 17:59:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 688E021479 for ; Sun, 15 Sep 2019 17:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568570354; bh=3iVHizz3yPUdmPWf/UUdhVjTgz95VodYGfLbqA+qhQk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=Twd3vpcG0+vJMWMEn4r2dW5BczLmlHqFfgT5H72sRr8PfKwW2WN0IxUjTcs+mLpr2 rioJf5AStX562EL7LivlewckV8N4ZpGXf/lxsdDa7RcazxWyiCElvbhTwVp37/W1HB jFq7UqJpUoLLuoWyHu8brHwiH1e2NU8PMLRdHeek= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728617AbfIOR7N (ORCPT ); Sun, 15 Sep 2019 13:59:13 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42623 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbfIOR7N (ORCPT ); Sun, 15 Sep 2019 13:59:13 -0400 Received: by mail-lj1-f194.google.com with SMTP id y23so31609540lje.9 for ; Sun, 15 Sep 2019 10:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pFQ6bLEw0DqXlupLVO397W33Z9udTXaB1tTGFV03T54=; b=YaFGb+aTEgk0cbA7zrNK6fWBL4dLqYgY6pCQ0cxjeZjBOIcsxidFhiCb/ZBSRorHSs hg+lIfR1CrLgEsRsulrQuW5G8eAUbsa6GNFVWh+xqRckDxqvUe2WzqgLdw5PDX+Ri8Z7 LGsM/BRv7P4bM4a9GQ3S2blH5lEySy1CrClPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pFQ6bLEw0DqXlupLVO397W33Z9udTXaB1tTGFV03T54=; b=I5jcKJQ9smMN+wNwZslKVI+gKi4549QvkItiTly2btKL8m6oxeLxVE1OgRF7Sy0Obb Uzc8ZACwUMwiLkmw86wlwe9vMh5f5Mor+O8OD0dX9+lwRsr5gthDyAdinLReXOqhQjEi rHpM5m5WYkqamE4pbjqJe70T2qUMwxXqLO3OI9/KYPIZP+jJ+d0XAoyxlnv2+fdHQWis a7ddNpo//bG7da1VbRGuoX9BDApxnegk2yiD1hEH1/y+b7e/a1bCZo5lajGVCj7HagEU euDhP9H42s2ys4JklkUCuYhCoXgWc6O9CScmqZ8XeBj5jT4/M7G6AqpTCgO4pGs07B5v rL4w== X-Gm-Message-State: APjAAAUXWasgxPICnoupuabVdGpLN9eyrXG5/rC6Ci5G7p0wtuMzn82P lY63336NAkPqEneUOplAz5TylkaLc8c= X-Google-Smtp-Source: APXvYqywa5F6vESyH9H4jyeUED0XJCcm1RF409+khFxLNb3OTz8foSQnRnBin0sb6rqL/hwM6mOD1Q== X-Received: by 2002:a2e:861a:: with SMTP id a26mr29386627lji.163.1568570349434; Sun, 15 Sep 2019 10:59:09 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id r19sm7928536ljd.95.2019.09.15.10.59.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Sep 2019 10:59:07 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id r134so25644685lff.12 for ; Sun, 15 Sep 2019 10:59:06 -0700 (PDT) X-Received: by 2002:a19:7d55:: with SMTP id y82mr36222080lfc.106.1568570346434; Sun, 15 Sep 2019 10:59:06 -0700 (PDT) MIME-Version: 1.0 References: <7e32cda5-dc89-719d-9651-cf2bd06ae728@huawei.com> <20190910215357.GH1131@ZenIV.linux.org.uk> <20190914161622.GS1131@ZenIV.linux.org.uk> <20190914170146.GT1131@ZenIV.linux.org.uk> <20190914200412.GU1131@ZenIV.linux.org.uk> <20190915005046.GV1131@ZenIV.linux.org.uk> <20190915160236.GW1131@ZenIV.linux.org.uk> In-Reply-To: <20190915160236.GW1131@ZenIV.linux.org.uk> From: Linus Torvalds Date: Sun, 15 Sep 2019 10:58:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Re: Possible FS race condition between iterate_dir and d_alloc_parallel To: Al Viro Cc: "zhengbin (A)" , Jan Kara , Andrew Morton , linux-fsdevel , "zhangyi (F)" , renxudong1@huawei.com, Hou Tao Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sun, Sep 15, 2019 at 9:02 AM Al Viro wrote: > > Could be done, AFAICS. I'm not even sure we need a flag per se - we > have two cases when the damn thing is not in the list and "before > everything" case doesn't really need to be distinguished from post-EOF > one. Agreed, it looks like we could just look at f_pos and use that (together with whether we have a cursor or not) as the flag: - no cursor: f_pos < 2 means beginning, otherwise EOF - otherwise: cursor points to position > > I wonder why we have that naming to begin with, but it's so old that I > > can't remember the reason for that confusing naming. If there ever was > > any, outside of "bad thinking". > > ->d_subdirs/->d_child introduction was what, 2.1.63? November 1997... Heh. Your google-fu was better than mine. > http://lkml.iu.edu/hypermail/linux/kernel/9711.0/0250.html > with nothing public prior to that. What has happened to Bill Hawes, BTW? I think the original submission predates that by some time. Afaik, the original dentry patches were for a PhD thesis or something like that, and in the original form is was not used for caching and lookup, but to generate filenames for logging. .. and that may in fact be why it had the list of children being called "d_subdirs". Because the dentry patches originally were about tracking the changes to the directory structure, and so only tracking subdirectories was interesting. As to Bill Hawes: "Now there's a name I've not heard in a long, long time. A long time." I don't find anything after 98. Linus