From: Darrick J. Wong Date: Thu, 28 Aug 2025 17:30:43 +0000 (-0700) Subject: fuse2fs: make norecovery behavior consistent with the kernel X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ce46d47e964071d8d6c1777e3ce90bd5a457095;p=thirdparty%2Fe2fsprogs.git fuse2fs: make norecovery behavior consistent with the kernel Amazingly, norecovery/noload on the kernel ext4 driver allows a read-write mount even for journalled filesystems. The one case where mounting fails is if there's a journal and it's dirty AND you didn't specify norecovery. Make the fuse2fs option behave the same as the kernel. Also, ext2fs_run_ext3_journal doesn't explicitly check EXT2_FILE_RW state, which means fuse2fs must do that. Found via ext4/271. Cc: # v1.43 Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs") Signed-off-by: "Darrick J. Wong" --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 931e60f6..99227477 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -4818,6 +4818,11 @@ int main(int argc, char *argv[]) _("Mounting read-only without recovering journal.")); fctx.ro = 1; global_fs->flags &= ~EXT2_FLAG_RW; + } else if (!(global_fs->flags & EXT2_FLAG_RW)) { + err_printf(&fctx, "%s\n", + _("Cannot replay journal on read-only device.")); + ret = 32; + goto out; } else { log_printf(&fctx, "%s\n", _("Recovering journal.")); err = ext2fs_run_ext3_journal(&global_fs);