1
0
forked from pool/util-linux
util-linux/sfdisk-warn-about-2TB-limit.patch

32 lines
1.0 KiB
Diff
Raw Normal View History

Index: util-linux-2.19.1/fdisk/sfdisk.c
===================================================================
--- util-linux-2.24.1.orig/fdisks/sfdisk.c
+++ util-linux-2.24.1/fdisks/sfdisk.c
@@ -1271,6 +1271,26 @@ partitions_ok(int fd, struct disk_desc *
return 0;
}
}
+ /* Are the data partitions and the extended partition
+ within the DOS 2TB limit? */
+ for (p = partitions; p < partitions+partno; p++) {
+ if (p->size && !is_extended(p->p.sys_type)) {
+ if( p->size >= (unsigned long) 0xffffffff ) {
+ warn(_("Warning: partition %s of size %lu exceeds "
+ "msdos 2TB limit.\n"),
+ PNO(p), p->size);
+ return 0;
+ }
+ for (q = partitions; q < partitions+partno; q++)
+ if (is_extended(q->p.sys_type))
+ if ( q->size >= (unsigned long) 0xffffffff ) {
+ warn(_("Warning: partition %s of size %lu exceeds "
+ "msdos 2TB limit.\n"),
+ PNO(q), q->size);
+ return 0;
+ }
+ }
+ }
/*
* Do all partitions start at a cylinder boundary ?