Whamcloud - gitweb
ChangeLog, mke2fs.c:
authorTheodore Ts'o <tytso@mit.edu>
Mon, 29 May 2000 15:05:42 +0000 (15:05 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 29 May 2000 15:05:42 +0000 (15:05 +0000)
  mke2fs.c (PRS): Add a much more specific error message if the
   filesystem size is defaulted and get_device_size returns a size of
   zero.  Otherwise, users get a confusing "invalid argument while passed
   to ext2 library" error message.

misc/ChangeLog
misc/mke2fs.c

index f9fc009..44062ef 100644 (file)
@@ -1,3 +1,10 @@
+2000-05-29  Theodore Ts'o  <tytso@valinux.com>
+
+       * mke2fs.c (PRS): Add a much more specific error message if the
+               filesystem size is defaulted and get_device_size returns a
+               size of zero.  Otherwise, users get a confusing "invalid
+               argument while passed to ext2 library" error message.
+
 2000-05-08  Theodore Ts'o  <tytso@valinux.com>
 
        * fsck.c (interpret_device): Add better error messages if a UUID=
index 3026f4c..5d012c1 100644 (file)
@@ -949,8 +949,22 @@ static void PRS(int argc, char *argv[])
                                "must specify\nthe size of the "
                                "filesystem\n"));
                        exit(1);
-               } else
+               } else {
+                       if (dev_size == 0) {
+                               com_err(program_name, 0,
+                               _("Device size reported to be zero.  "
+                                 "Invalid partition specified, or\n\t"
+                                 "partition table wasn't reread "
+                                 "after running fdisk, due to\n\t"
+                                 "a modified partition being busy "
+                                 "and in use.  You may need to reboot\n\t"
+                                 "to re-read your partition table.\n"
+                                 ));
+                               exit(1);
+                       }
                        param.s_blocks_count = dev_size;
+               }
+               
        } else if (!force && (param.s_blocks_count > dev_size)) {
                com_err(program_name, 0,
                        _("Filesystem larger than apparent filesystem size."));