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_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32286 invoked from network); 31 Dec 2021 05:13:09 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 31 Dec 2021 05:13:09 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id B18F29D048; Fri, 31 Dec 2021 15:13:04 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id D406C9D006; Fri, 31 Dec 2021 15:12:34 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20210112.gappssmtp.com header.i=@iitbombay-org.20210112.gappssmtp.com header.b="ITlVc0ba"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id BD0E99D006; Fri, 31 Dec 2021 15:12:31 +1000 (AEST) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by minnie.tuhs.org (Postfix) with ESMTPS id 6295B9D002 for ; Fri, 31 Dec 2021 15:12:30 +1000 (AEST) Received: by mail-qk1-f182.google.com with SMTP id de30so24477800qkb.0 for ; Thu, 30 Dec 2021 21:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20210112.gappssmtp.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ToHLtWf2hHSY1A36RaX1VSsShAXcNxRTVzWW1/JPErA=; b=ITlVc0baIlNCrCgPMIinh/mDfTfl21gjrBAWpMTupOgebbA6cNOwfyIASFGC4NVk9S FfzfhN/0ddcTFWRN9yku3OZKRtxdNU++1Cq4nge4wdi5/9+kBpof4Ihin87Jq2Fp7GpU ODkXxcb/VLIXJIrZ4C3hb/ICOcV+7pkqPPavHjoZ6IP++SBAQpAZyTOsF6oIjk1bRKjZ YM1NIjTgFVDflir3/8UjGG1e2ERYcEn007SwGq8PW/5i/8ZPA4oKGdkUA0A0uDjjENKN Fj14+uMJdscgUpa6/cvss3DBEb5fgjOKR0o/wfm9PfK1uguOdfd1NAOcx80jnEYB9z47 No/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ToHLtWf2hHSY1A36RaX1VSsShAXcNxRTVzWW1/JPErA=; b=WsyYUteOxFzyHybO01k1KKxH18InTQhxhTyGcLQ64xSjdPe2rV/6HnRmaIuRyfngy5 nKdTprTvhzdgqUgHDfMyVDT1BxypZzX5jnQWwuDowMCjfnmLSbSvzWPhGWXxFfE7Ar+D uvsJq+E3dJINoxeIgDlwKkUuocIIycBCS/k653HG4jphRpipkykMrqNfMf947TIffX23 ofxh3Zg4fsdUiIsUV/pD27AIkhUBaPm7Nc68mTDp3jxxzTOfcjRgDt3bohTx/3VgWr01 KZtX3zt1vlyt/l+mPC3UyILyH1B8XC9/XyqfkDpatyGiq0H3BGOEeQXPKppYZQS6WJfI Y7Jw== X-Gm-Message-State: AOAM532mgt4ONa+eaoDvjiE91DpLQsKjNbiL4uq2ZJf7FiYxrPsaxrM7 j1HVJ7Ht37diLvs+2dGY4zorRA== X-Google-Smtp-Source: ABdhPJzTfBqId/safjtemT6lOFhmQFLoUokzcAnqUDyKc5vo9Mw7J8P/FqMQ4Zcgt3SLQ0VoM6GcTg== X-Received: by 2002:a05:620a:430b:: with SMTP id u11mr24028789qko.70.1640927549397; Thu, 30 Dec 2021 21:12:29 -0800 (PST) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id n19sm22146676qta.78.2021.12.30.21.12.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Dec 2021 21:12:28 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) From: Bakul Shah In-Reply-To: Date: Thu, 30 Dec 2021 21:12:26 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <6B72AED1-90F2-4F18-BE6E-BA0CAC4380D0@iitbombay.org> References: <20211230034512.B9B3718C08E@mercury.lcs.mit.edu> To: Theodore Ts'o X-Mailer: Apple Mail (2.3693.40.0.1.81) 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 Dec 30, 2021, at 7:08 PM, Theodore Ts'o wrote: >=20 > On Thu, Dec 30, 2021 at 05:31:09PM -0500, Dan Cross wrote: >> 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 >>>>=20 >>>>> My guess is *not* storing a path instead of a ptr to the inode was = done >>>>> to save on memory. >>>>=20 >>>> 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. >>>=20 >>> 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. >>=20 >> 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. >=20 > I was responding to Bakul's suggestion that the original Unix > could/should have stored the cwd as a string, instead of a pointer to > a directory inode. If you stored the cwd as a string, then you could > interpret .. by chopping off the last file name component of the > string, and so now you could have hard links to directories and the > file system tree could then be a file system DAG. >=20 > I don't think Bakul's proposal would have worked --- although I > suppose if you disallowed directory renames, I guess it could. =20 Note that this is already broken! $ mkdir -p ~/a/b; cd ~/a/b; mv ~/a /tmp # /tmp is on a diff filesystem $ cd .. cd: no such file or directory: ..=20 At least with the change[1] I was talking about, cd .. would not be an error! At least with this change the behavior is more consistent! Now if you want bug for bug compatibility then yes, you can't make any changes but usually it is more a cost/benefit tradeoff as far as any breaking changes are concerned. NFS broke a few things for example and most of us put up with that. [1] cwd as string, not allowing multiple links to a dir. I speculated about the latter but any benefit is not worth the cost. not worth it.