Received: by 10.192.165.148 with SMTP id m20csp2585746imm; Sun, 6 May 2018 19:17:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWtTdg4Ok3OFsRe8xp/mR8Qlmnk4FKn+Td96cRHxrjvMJUo+0F7MeetoE4C0lZ4IfDgP8C X-Received: by 2002:a17:902:6045:: with SMTP id a5-v6mr35995356plt.138.1525659475997; Sun, 06 May 2018 19:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525659475; cv=none; d=google.com; s=arc-20160816; b=S+4LJgfUAcU6gtKU1rAvbEplA+S8ovkvywfYt8uTHt8heJWlP7bDRnlmcJBQAjYU3O bBfxX6eqLo/zJoaLCRVLxlC7KUziduF77yV7otA54IaxIEE6GA5CcUO/A53m33PBsaX4 pAAaicObSKL3gOUsQfzDXhvyOuIcPMqLcN6WcoyrFLoOoB54A/PZsnR8Z3KEM6Sv9qzi qqIJbtpgjL+F/lJSDnWNnN1QZHx0mTlf1DrqCAqCumOiE9noNPQLd4ak1/SLT1eqEssj RIgLgpooroEFXlz6+dgWPsrTmZ6R1d4iIHpSZacBAhYX/uP23Gu19eHyZIdhvBhHiq3u ldYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=l2yETRy6hLfSkmwMxwmPqJT4wIMxpQEPvFzOLrDPg6Y=; b=m7WNVLUEsk8tcvZwlPNOka+Tu3ApeFs3WUgn4rP/YDI/4TNBo4H1QV6smosgVxS4io 57fUolLhCn99u+3YRDYiY43GwuttQPcXJQ0UL2MtVwgxQdakMIid0naLeg1HniT/IrFC 6KPx3tHk6lXhStzK6y5GVRwSOcHX7fdMYUjycM4D1yOBQakqVsB0pYT+hj6u9yX0UGaF HL+xHpDAXLwXpkporl8AXTGEVef4gyl5Rlf3e3Wn2yEM1i8VxNjBXKiCeP1GVWDV2wpt hy6P7zW8yvifcjzPkuu+KFIKd1SrkfhOkdYVIyHewNbGphlQScrLRxD/xWH08orxqD96 oChA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si20159839pfv.135.2018.05.06.19.17.41; Sun, 06 May 2018 19:17:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751927AbeEGCQK (ORCPT + 99 others); Sun, 6 May 2018 22:16:10 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51230 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbeEGCQG (ORCPT ); Sun, 6 May 2018 22:16:06 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fFVgw-0002PO-MI; Mon, 07 May 2018 02:15:54 +0000 Date: Mon, 7 May 2018 03:15:54 +0100 From: Al Viro To: John Paul Adrian Glaubitz Cc: Martin Steigerwald , Matthew Wilcox , dsterba@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , linux-m68k@lists.linux-m68k.org, Debian m68k Subject: Re: moving affs + RDB partition support to staging? Message-ID: <20180507021554.GN30522@ZenIV.linux.org.uk> References: <20180425154602.GA8546@bombadil.infradead.org> <20180425203029.GQ21272@twin.jikos.cz> <20180426025717.GA32430@bombadil.infradead.org> <1613268.lKBQxPXt8J@merkaba> <76ca15e2-7b43-8b02-43e1-9ee65ab85356@physik.fu-berlin.de> <20180506005946.GI30522@ZenIV.linux.org.uk> <20180506073955.GJ30522@ZenIV.linux.org.uk> <20180506204622.GL30522@ZenIV.linux.org.uk> <20180506213247.GM30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180506213247.GM30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 06, 2018 at 10:32:47PM +0100, Al Viro wrote: > On Sun, May 06, 2018 at 09:46:23PM +0100, Al Viro wrote: > > > I'm fixing that pile of crap (along with the NFS exports > > one and, hopefully, rename mess as well). HOWEVER, I am not going > > to take over the damn thing - David has violated the 11th > > commandment (Thou Shalt Never Volunteer), so he gets to joy of > > learning that codebase and taking care of it from now on. > > Same scenario on link(2) ends up with > * ST_LINKFILE created, inserted into the link chain and left around, > without being present in any hash chain > * target becoming positive hashed dentry, as if link(2) has succeeded, > so dcache lookups will be finding it (for a while) > * unlink(2) on source will have very interesting effects, what with > the attempts to move ST_FILE entry into the directory presumed to > contain ST_LINKFILE one, removing ST_LINKFILE from it at the same time. Oh, lovely... Looks like that thing wants the hash chains sorted by block number. affs_insert_hash() doesn't give a toss - it always adds to the very end of chain. Maintaining that requirement (and I can understand the rationale - they don't want too many back-and-forth seeks on directory lookups) is going to be great fun on rename(), especially for the case when the target of rename happens to be a primary name for a file with additional hardlinks. I think I see how to deal with that sanely, but... ouch. Incidentally, we'd better verify that hash chains are not looped - as it is, there's no checks whatsoever, and it *will* happily loop if you feed it an image with such braindamage. I really hope that no fan of desktop experience has set the things up for e.g. USB sticks with that on them being recognized and automounted on insertion...