From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C79E718DB26 for ; Fri, 17 Oct 2025 23:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760743858; cv=none; b=WHEFiLqp2fpnZm8izbqW1UaRfIOEZsAHxdEPvbuQoVsmV7Y6i9TJrEOu5C1DXXhx+ahYnxk5cd+t5JdoDjRFs/4FGRiED6znPdovQAivo4lvSmHdRz4rjIZC6HHt3gqwUg1DpwarCMo01U0E9QTy1nOqL1EGsMpXSsfu2w4OxvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760743858; c=relaxed/simple; bh=CkQDOZAUVQEfoAAx+WUnaILLe7RRyuCElz1XXQ+m+Jg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mdMnsz/JQIlOs/AiLFojXFIBDIRVj+J7Eaa3c6kiIov3sb2LsKOOuysoPHCYmpf6/TtP96pY+tYvXZy5S1AlcaEoIefto7IOJAFU9OmRKCd9sIDiJUaDigH9ngfXldiMq56kRuA53rjqFh6Bt9yaVH/5M0D+GOdpj5LRJU4/a2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fk31ghA5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fk31ghA5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93741C4CEE7; Fri, 17 Oct 2025 23:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760743858; bh=CkQDOZAUVQEfoAAx+WUnaILLe7RRyuCElz1XXQ+m+Jg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fk31ghA5dmrDhXvZWKpqVvRmuktiZQSbeIDbY09MIS6Bc35gfBwv68vYASmjIBopG 3BGxhhJMquER1hXm+yznXkpEuRSFBh79cd7cNgT85GlRPXgIjv9wIr3cgcC0WMSCuC mCTmzYCmEYP/01umx9a3Z6tCvyWBFgd8Qy7UjAtRA77pApAkn56lIX38QyWNziF4K3 Lzi5856ANbaZRgRz+sfeF7ZKEBB7ccMl3oCqwBi/qsZdi6N1It8aiVfJCGEyKy0hXt Q3Q239xg7DTG8p6n5ylzTwESlbNm5MPsP5cW2Cgc/hHWoVUu5Cj0Q0L9+55m+a5fdN qjuSkEh/v9aGA== Date: Fri, 17 Oct 2025 16:30:57 -0700 From: "Darrick J. Wong" To: Dave Dykstra Cc: tytso@mit.edu, linux-ext4@vger.kernel.org Subject: Re: [PATCH 1/2] fuse2fs: mount norecovery if main block device is readonly Message-ID: <20251017233057.GK6170@frogsfrogsfrogs> References: <175798064753.350013.16579522589765092470.stgit@frogsfrogsfrogs> <175798064776.350013.6744611652039454651.stgit@frogsfrogsfrogs> <20251017193841.GH6170@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Oct 17, 2025 at 03:20:00PM -0500, Dave Dykstra wrote: > On Fri, Oct 17, 2025 at 12:38:41PM -0700, Darrick J. Wong wrote: > > On Thu, Oct 16, 2025 at 02:34:18PM -0500, Dave Dykstra wrote: > ... > > > > + err_printf(ff, "%s.\n", > > > > + _("read-only device, trying to mount norecovery")); > > > > + flags &= ~EXT2_FLAG_RW; > > > > + ff->ro = 1; > > > > + ff->norecovery = 1; > > > > > > I don't think it's good to switch to read-only+norecovery even when a > > > read-write mode was requested. That goes too far. > > > > The block device cannot be opened for write, so the mount cannot allow > > user programs to write to files, and the fs driver cannot recover the > > journal and it cannot write to the disk. The only other choice would > > be to fail the mount. > > Yes, I think it's better to fail the mount if recovery is needed and it > can't be done. > > > norecovery is wrong though. The kernel fails the mount if the journal > > needs recovery, the block device is ro, and the user didn't specify > > norecovery. > > That makes more sense. > > > > It also doesn't catch when recovery is needed. > > > > What specifically do you mean "catch when recovery is needed"? 68 lines > > down from the ext2fs_open2 call is a check for the needsrecovery state, > > followed by recovering the journal. > > I meant that it should fail in that case because it can't recover. > > > > My proposed patch only reopens read-only > > > when ro was requested and then later checks to see if recovery is needed > > > and if so, errors out. > > > > Your patch also didn't re-check the feature support after reopening the > > block device, which you dismissed even though that can lead to > > catastrophic behavior. > > In this version of the patch there is no reopening, there is only a > switch to open without RW if the RW open fails. So all feature checks > happen after it. Well I'm struggling to reshuffle my patch deck to keep up with you. I already _had_ patches to fix every thing you've mentioned, but since you pre-declared you wouldn't make time even to go look at my patch stack why the hell am I even bothering? I no longer have patience for these interactions. --D > Dave >