Package: e2fsprogs
Version: 1.42.13-1

Making a filesystem with a raw block device will semi-randomly prompt
asking if we are sure. This is because `check_plausibility()` assumes
that the Linux device numbering code assumes that raw block devices are
assigned minor versions that are 0 modulo 64, when modern Linux systems
are 0 modulo 16.

A patch was submitted to upstream yesterday. It has signed-off from both
myself and Andreas Dilger:

http://article.gmane.org/gmane.comp.file-systems.ext4/48840

HEAD moved the code that needs to be patched from misc/util.c to
misc/plausibility.c, so the upstream patch does not apply to Debian's
packaging. I have taken the liberty of backporting the patch to
e2fsprogs-1.42.13-1 below.

I realize that upstream has not had time to process this yet and that
upstream and downstream are the same for e2fsprogs in Debian, but my
collegues insisted that I file issues with major distributions to
request this patch be backported anyway. If I should have waited for a
solution to be merged upstream, please let me know so that I can pass
that information on to my collegues.

diff --git a/misc/util.c b/misc/util.c
index 40c8858..7f413ee 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -18,9 +18,6 @@
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#ifdef HAVE_LINUX_MAJOR_H
-#include <linux/major.h>
-#endif
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
@@ -104,36 +101,6 @@ void check_plausibility(const char *device)
                proceed_question();
                return;
        }
-
-#ifdef HAVE_LINUX_MAJOR_H
-#ifndef MAJOR
-#define MAJOR(dev)     ((dev)>>8)
-#define MINOR(dev)     ((dev) & 0xff)
-#endif
-#ifndef SCSI_BLK_MAJOR
-#ifdef SCSI_DISK0_MAJOR
-#ifdef SCSI_DISK8_MAJOR
-#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
-  ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) || \
-  ((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR))
-#else
-#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
-  ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR))
-#endif /* defined(SCSI_DISK8_MAJOR) */
-#define SCSI_BLK_MAJOR(M) (SCSI_DISK_MAJOR((M)) || (M) == SCSI_CDROM_MAJOR)
-#else
-#define SCSI_BLK_MAJOR(M)  ((M) == SCSI_DISK_MAJOR || (M) == SCSI_CDROM_MAJOR)
-#endif /* defined(SCSI_DISK0_MAJOR) */
-#endif /* defined(SCSI_BLK_MAJOR) */
-       if (((MAJOR(s.st_rdev) == HD_MAJOR &&
-             MINOR(s.st_rdev)%64 == 0) ||
-            (SCSI_BLK_MAJOR(MAJOR(s.st_rdev)) &&
-             MINOR(s.st_rdev)%16 == 0))) {
-               printf(_("%s is entire device, not just one partition!\n"),
-                      device);
-               proceed_question();
-       }
-#endif
 }
 
 void check_mount(const char *device, int force, const char *type)


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to