Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3179813pxk; Mon, 5 Oct 2020 03:18:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgEpyqEU5TncmIaDwJQfqHG9Rf6maK1FHBFohJCsrYoNMxg/9HET9HTNyoJHx5vOuUtr/c X-Received: by 2002:a17:906:7016:: with SMTP id n22mr1447210ejj.402.1601893091757; Mon, 05 Oct 2020 03:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601893091; cv=none; d=google.com; s=arc-20160816; b=yOL8e7dsPovBnSXD7ab+QapfYBiwrtQZ3nSz0Qnj5urhWJykyxPnEnl1uCviscVvCy JQgFMHEY69OvDNrw7gQXxxkTr9a9x7S31rM0YB9kM0fL1DEQ9n4FIXYyK5fDsKuM7Ysq 9dfdQVwL7aPhN6k7zywPbb5+/z6Q2jkObF5RyjPaZaBioCAnz27vwXmCgOTcRJFJ8I+T 8zX3NOR3CWuVaxIHoJnB2p+Ht2VT5khNtih6rimiq4hDHqtDM4JkKp+iv0yR+CmQNxBe YnnlFbtlzrGA+SSfYLSKkiIeprPsfURHIvJQqDw3qMznyC7oFl6dEmGt1YAQOAsTqo1K DIuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=NQIO5lLU32BJgRZe6TZvbiXau444iiIAL3mtDEfOCeE=; b=puVlB1fNn45sdKcnt3Ct2Kd6SnpHHLSF1BNqjbkGxYu/nX9S532pyMd2j6uOggnadg +UROOo7NCFTr9Z5bmvsRmRkZHPn2Z3hNsVg313N3eLSdvw5Jig+oJb+RXBP4NzTsryG6 0M0F6j3y+s2tGKe8jpOmF/b2JhwivrZ+acOlML0fJdIVWtL7gKwenzGecdbuslm+/ALp eI+st2JIBj4krSpy3wcDgxhfKWfQN63yATGK5TH/ChGY5iQ473fal9zkCnA2KJScPNsb 8nrXZkjeAEn08WRKx/WscNzS424goMT1EXMh+r28LHUkDWdmWEciCTIWm428KdeijPt8 NPvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si6285507ejy.632.2020.10.05.03.17.38; Mon, 05 Oct 2020 03:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbgJEKQu (ORCPT + 99 others); Mon, 5 Oct 2020 06:16:50 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:40039 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgJEKQt (ORCPT ); Mon, 5 Oct 2020 06:16:49 -0400 X-Greylist: delayed 7303 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Oct 2020 06:16:48 EDT X-Originating-IP: 50.39.163.217 Received: from localhost (50-39-163-217.bvtn.or.frontiernet.net [50.39.163.217]) (Authenticated sender: josh@joshtriplett.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 3C0DD20009; Mon, 5 Oct 2020 10:16:42 +0000 (UTC) Date: Mon, 5 Oct 2020 03:16:41 -0700 From: Josh Triplett To: Jan Kara Cc: Linus Torvalds , Theodore Ts'o , Andreas Dilger , Jan Kara , Linux Kernel Mailing List , linux-ext4@vger.kernel.org Subject: Re: ext4 regression in v5.9-rc2 from e7bfb5c9bb3d on ro fs with overlapped bitmaps Message-ID: <20201005101641.GA516771@localhost> References: <20201005081454.GA493107@localhost> <20201005094601.GB4225@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005094601.GB4225@quack2.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Oct 05, 2020 at 11:46:01AM +0200, Jan Kara wrote: > On Mon 05-10-20 01:14:54, Josh Triplett wrote: > > Ran into an ext4 regression when testing upgrades to 5.9-rc kernels: > > > > Commit e7bfb5c9bb3d ("ext4: handle add_system_zone() failure in > > ext4_setup_system_zone()") breaks mounting of read-only ext4 filesystems > > with intentionally overlapping bitmap blocks. > > > > On an always-read-only filesystem explicitly marked with > > EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS, prior to that commit, it's safe to > > point all the block and inode bitmaps to a single block of all 1s, > > because a read-only filesystem will never allocate or free any blocks or > > inodes. > > However, after that commit, the block validity check rejects such > > filesystems with -EUCLEAN and "failed to initialize system zone (-117)". > > This causes systems that previously worked correctly to fail when > > upgrading to v5.9-rc2 or later. > > > > This was obviously a bugfix, and I'm not suggesting that it should be > > reverted; it looks like this effectively worked by accident before, > > because the block_validity check wasn't fully functional. However, this > > does break real systems, and I'd like to get some kind of regression fix > > in before 5.9 final if possible. I think it would suffice to make > > block_validity default to false if and only if > > EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS is set. > > > > Does that seem like a reasonable fix? > > Well, but EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS is your internal feature > that's not present in current upstream kernel AFAICS. It isn't "my" feature; the value for EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS is defined in the headers in the e2fsprogs tree. The kernel currently does absolutely nothing with it, nor did it previously need to; it's just an RO_COMPAT feature which ensures that the kernel can only mount the filesystem read-only. The point is that an always-read-only filesystem will never change the block or inode bitmaps, so ensuring they don't overlap is unnecessary (and harmful). I only added EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS to the header to generate the corresponding ext4_has_feature_shared_blocks function. I have filesystems that previous kernels mounted and worked with just fine, and new kernels reject. That seems like a regression to me. I'm suggesting the simplest possible way I can see to fix that regression. Another approach would be to default block_validity to false for any read-only filesystem mount (since it won't be written to), but that seemed like it'd be more invasive; I was going for a more minimal change.