Whamcloud - gitweb
create_inode: remove backup definition of __func__
[tools/e2fsprogs.git] / misc / mke2fs.c
index cd6e614..68fbb66 100644 (file)
@@ -52,14 +52,14 @@ extern int optind;
 #include "ext2fs/ext2fsP.h"
 #include "uuid/uuid.h"
 #include "util.h"
-#include "plausible.h"
-#include "profile.h"
-#include "prof_err.h"
+#include "support/nls-enable.h"
+#include "support/plausible.h"
+#include "support/profile.h"
+#include "support/prof_err.h"
 #include "../version.h"
-#include "quota/quotaio.h"
+#include "support/quotaio.h"
 #include "mke2fs.h"
 #include "create_inode.h"
-#include "nls-enable.h"
 
 #define STRIDE_LENGTH 8
 
@@ -1088,9 +1088,7 @@ static __u32 ok_features[3] = {
                EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|
                EXT4_FEATURE_RO_COMPAT_GDT_CSUM|
                EXT4_FEATURE_RO_COMPAT_BIGALLOC|
-#ifdef CONFIG_QUOTA
                EXT4_FEATURE_RO_COMPAT_QUOTA|
-#endif
                EXT4_FEATURE_RO_COMPAT_METADATA_CSUM
 };
 
@@ -2500,7 +2498,9 @@ static int mke2fs_setup_tdb(const char *name, io_manager *io_ptr)
 
        /* (re)open a specific undo file */
        if (undo_file && undo_file[0] != 0) {
-               set_undo_io_backing_manager(*io_ptr);
+               retval = set_undo_io_backing_manager(*io_ptr);
+               if (retval)
+                       goto err;
                *io_ptr = undo_io_manager;
                retval = set_undo_io_backup_file(undo_file);
                if (retval)
@@ -2508,7 +2508,7 @@ static int mke2fs_setup_tdb(const char *name, io_manager *io_ptr)
                printf(_("Overwriting existing filesystem; this can be undone "
                         "using the command:\n"
                         "    e2undo %s %s\n\n"), undo_file, name);
-               return 0;
+               return retval;
        }
 
        /*
@@ -2544,10 +2544,14 @@ static int mke2fs_setup_tdb(const char *name, io_manager *io_ptr)
 
        if ((unlink(tdb_file) < 0) && (errno != ENOENT)) {
                retval = errno;
+               com_err(program_name, retval,
+                       _("while trying to delete %s"), tdb_file);
                goto errout;
        }
 
-       set_undo_io_backing_manager(*io_ptr);
+       retval = set_undo_io_backing_manager(*io_ptr);
+       if (retval)
+               goto errout;
        *io_ptr = undo_io_manager;
        retval = set_undo_io_backup_file(tdb_file);
        if (retval)
@@ -2986,9 +2990,14 @@ int main (int argc, char *argv[])
        }
 
        if (super_only) {
+               check_plausibility(device_name, CHECK_FS_EXIST, NULL);
+               printf(_("%s may be further corrupted by superblock rewrite\n"),
+                      device_name);
+               if (!force)
+                       proceed_question(proceed_delay);
                fs->super->s_state |= EXT2_ERROR_FS;
                fs->flags &= ~(EXT2_FLAG_IB_DIRTY|EXT2_FLAG_BB_DIRTY);
-               /* 
+               /*
                 * The command "mke2fs -S" is used to recover
                 * corrupted file systems, so do not mark any of the
                 * inodes as unused; we want e2fsck to consider all
@@ -3141,7 +3150,7 @@ no_journal:
                                     EXT2_ROOT_INO);
                if (retval) {
                        com_err(program_name, retval, "%s",
-                               _("\nError while populating file system\n"));
+                               _("while populating file system"));
                        exit(1);
                } else if (!quiet)
                        printf("%s", _("done\n"));