[PATCH 06/10] 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.

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 364d26a4e0e00e..7c61c470723a88 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -755,6 +755,12 @@ static errcode_t check_fs_supported(struct fuse2fs *ff)
 		return EXT2_ET_UNSUPP_FEATURE;
 	}
 
+	if (fs->super->s_state & EXT2_ERROR_FS) {
+		err_printf(ff, "%s\n",
+ _("Errors detected; running e2fsck is required."));
+		return EXT2_ET_FILESYSTEM_CORRUPTED;
+	}
+
 	return 0;
 }
 
@@ -831,12 +837,6 @@ _("Mounting read-only without recovering journal."));
 		err_printf(ff, "%s\n",
  _("Orphans detected; running e2fsck is recommended."));
 
-	if (fs->super->s_state & EXT2_ERROR_FS) {
-		err_printf(ff, "%s\n",
- _("Errors detected; running e2fsck is required."));
-		return EXT2_ET_FILESYSTEM_CORRUPTED;
-	}
-
 	return 0;
 }
 





[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