3
0
forked from pool/util-linux
util-linux/sfdisk-warn-about-2TB-limit.patch
Marcus Meissner 1806747cca Accepting request 226509 from home:sbrabec:branches:Base:System
- Merge fixes and features from SLE11 (bnc#831868):
  * Detect squashfs version <= 3 as squashfs3 and version >= 4 as
    squashfs. (mszeredi@suse.cz,
    util-linux-ng-2.16-squashfs3-detect.patch, bnc#666893)
  * add sfdisk-warn-about-2TB-limit.patch (puzel@novell.com,
    bnc#495657)
  * Document barrier option in mount.8 (jack@suse.cz,
    hvogel@suse.de,
    util-linux-ng-2.19.1-barrier_documentation.patch, bnc#489740)
  * lscpu: improve hypervisor detection (puzel@novell.com,
    fate#310255)
    - util-linux-lscpu-improve-hypervisor-detection.patch
  * umount: avoid calling readlink on mountpoints if not necessary
    - add: umount-avoid-readlink.patch (puzel@suse.com, bnc#794529)
  * fix file conflict between util-linux and s390-32
    (puzel@suse.com, bnc#805684)
  * util-linux-update-default-commit-interval.patch:
    mount(8): update default commit interval (puzel@suse.com,
    bnc#809480)
  * Obsolete no more packaged uuid-runtime.
- Add uname26 (util-linux-setarch-uname26.patch, FATE#313476).

OBS-URL: https://build.opensuse.org/request/show/226509
OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=227
2014-03-20 08:19:43 +00:00

32 lines
1.0 KiB
Diff

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 ?