From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15191 invoked from network); 30 Dec 2021 22:32:17 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 30 Dec 2021 22:32:17 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id C58319D039; Fri, 31 Dec 2021 08:32:14 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EC6529D007; Fri, 31 Dec 2021 08:31:48 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cs6UJQaX"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 7FA9C9D004; Fri, 31 Dec 2021 08:31:46 +1000 (AEST) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by minnie.tuhs.org (Postfix) with ESMTPS id 09C069D002 for ; Fri, 31 Dec 2021 08:31:46 +1000 (AEST) Received: by mail-ot1-f51.google.com with SMTP id g79-20020a9d12d5000000b0058f08f31338so33906227otg.2 for ; Thu, 30 Dec 2021 14:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wE7d6kueP9k9l9+lWiLLGtWVqJqv8dyDjooblQNJpik=; b=Cs6UJQaXoJPekfuHqO82DMaG0vob5qddSDwYd2/VHxJ/CHWOYIQJa8uPjuPe3qfp9W q0IGg0ObfPsHD7kxrlFH8iKRJMFsqKSm0fd1fwtwILyNcuH09gg2w8KyG7JO5PHDzlSV JuTT2qHrETEYvx336ItFw3CE5ZwdiY10cr4BV65bPUeP7HaFZIsYjZpkVOgKplJSWLTY XhIkBJZc8S0pfOJhX1Z2bp9YrRAnK6BkfilXGOh3zrWFVnZXsHuf86XSr6U5mGnIGmzW QdGrH7yecRKL3SbP1MuwQU3WC46bafPjtxOaj2VYqaQOE0BXsa45hYsjAFdKKO+/tG8R JuIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wE7d6kueP9k9l9+lWiLLGtWVqJqv8dyDjooblQNJpik=; b=6SReaVMMFKjXwZH288bD6NasLdGwb9Lr1A5jOFIDFWg3GYW86lWjqHIW7MVF7ui8vZ 8e6NLmcGAN624uFm9ZJqOw1E9/Qbv1qiKlKGeZX/aVhKU3qaoUXZvw5XHI2yWBdPZ2EU ynP/kCuVY8V9isETY1i4Ii414jZp/1Jn5T20cbKiNQlsbGswdR/H1P8v3XHPVz34tQCi XQ/TpPnC7J7CgJAymwHrH6Udke7n5eAmnne+fxfKg76CcaPZJfO4tSBSdYAimU2xiat6 aLbjrkOGEIDLmQXbyhfiIJdpixJfbdw1FfciFdV7jPnS58rDfv5rE1HeNToAyKOMOr3t SiuQ== X-Gm-Message-State: AOAM5329fpU0FDRprLxlVXN3Od1pLCvJhbc1yCDgy4hqdmEiH6B2QC9U K8JSPTgYeA3KP38cowd24O3yvupL/BRxJSQSxT+NZcJS X-Google-Smtp-Source: ABdhPJzwzCpgRspgYWktEx3qm1UR0gxTFqouhW40Jjf1cgLVck5WO0tlqsjOIAa3gi/J9HXnm7Xjf6e7W8u7EO0zWCw= X-Received: by 2002:a9d:7084:: with SMTP id l4mr23378736otj.225.1640903505165; Thu, 30 Dec 2021 14:31:45 -0800 (PST) MIME-Version: 1.0 References: <20211230034512.B9B3718C08E@mercury.lcs.mit.edu> In-Reply-To: From: Dan Cross Date: Thu, 30 Dec 2021 17:31:09 -0500 Message-ID: To: "Theodore Ts'o" Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] moving directories in svr2 X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list , Noel Chiappa Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Thu, Dec 30, 2021 at 11:41 AM Theodore Ts'o wrote: > On Wed, Dec 29, 2021 at 10:45:12PM -0500, Noel Chiappa wrote: > > > From: Bakul Shah > > > > > My guess is *not* storing a path instead of a ptr to the inode was done > > > to save on memory. > > > > More probably speed; those old disks were not fast, and on a PDP-11, disk > > caches were so small that converting the path to the current directory to its > > in memory inode could take a bunch of disk reads. > > The other problem with storing the path as a string is that if > higher-level directories get renamed, the path would become > invalidated. If you store the cwd as "/foo/bar/baz/quux", and someone > renames "/foo/bar" to "/foo/sadness" the cwd-stored-as-a-string would > become invalidated. Why? Presumably as you traversed the filesystem, you'd cache, (path component, inode) pairs and keep a ref on the inode. For any given file, including $CWD, you'd know it's pathname from the root as you accessed it, but if it got renamed, it wouldn't matter because you'd have cached a reference to the inode. > Sure, you could scan the pwd of all the processes running on the > system and do edit all of the strings, but once you go SMP, the > potential locking pitfalls would be numerous. I don't see the need for that. What am I missing? - Dan C.