[PATCH 07/12] fuse2fs: check for recorded fs errors before touching things

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

Refuse the mount if there are errors recorded in the superblock.  We
should not be trying to replay the journal on damaged filesystems.

Cc: <linux-ext4@xxxxxxxxxxxxxxx> # v1.43
Fixes: 81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
---
 misc/fuse2fs.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)


diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index c201f95e771b85..415f174875922f 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -4723,6 +4723,12 @@ int main(int argc, char *argv[])
 		goto out;
 	}
 
+	if (global_fs->super->s_state & EXT2_ERROR_FS) {
+		err_printf(&fctx, "%s\n",
+ _("Errors detected; running e2fsck is required."));
+		goto out;
+	}
+
 	/*
 	 * ext4 can't do COW of shared blocks, so if the feature is enabled,
 	 * we must force ro mode.
@@ -4784,12 +4790,6 @@ int main(int argc, char *argv[])
 		err_printf(&fctx, "%s\n",
  _("Orphans detected; running e2fsck is recommended."));
 
-	if (global_fs->super->s_state & EXT2_ERROR_FS) {
-		err_printf(&fctx, "%s\n",
- _("Errors detected; running e2fsck is required."));
-		goto out;
-	}
-
 	/* Clear the valid flag so that an unclean shutdown forces a fsck */
 	if (global_fs->flags & EXT2_FLAG_RW) {
 		global_fs->super->s_mnt_count++;





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux