util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] sfdisk improvements
@ 2011-09-19 13:29 Petr Uzel
  2011-09-19 13:29 ` [PATCH 1/7] sfdisk: file descriptor is of int type Petr Uzel
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Petr Uzel @ 2011-09-19 13:29 UTC (permalink / raw)
  To: util-linux

Hi all,


First two patches are just minor fixes unrelated to the rest.


Third one makes sfdisk not to issue a fatal warning (overridable, though),
if the partition does not start/end on the cylinder boundary and
the unit specified is other than cylinders. These days,
we shouldn't care about the CHS that much IMO...


The last 4 sfdisk patches are followup to
http://www.spinics.net/lists/util-linux-ng/msg04760.html
http://www.spinics.net/lists/util-linux-ng/msg04761.html

The goal these patches is to use 64 bit integer types in sfdisk to
represent the sector numbers. This makes it easy to check if the numbers
overflew the DOS pt limit, which is 2^32. I also tried to detect the overflow
right at the moment when it happens (like Karel suggested), but this turned out
to be ugly.

I decided to use unsigned long long to represent the 64-bit integers,
which might not be the best choice (maybe we should use off_t or uint64_t
instead??). Comments are welcomed.

Thanks,


Petr Uzel (7):
  sfdisk: file descriptor is of int type
  sfdisk: fix weird indentation in msdos_partition()
  sfdisk: make the cylinder boundary check less fatal
  sfdisk: get_disksize() returns long long
  sfdisk: introduce get_ull() function
  sfdisk: use unsigned long long to internally represent sector number
  sfdisk: warn if partition exceeds partition table limits

 fdisk/sfdisk.c |  165 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 121 insertions(+), 44 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-09-27 13:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 13:29 [PATCH 0/7] sfdisk improvements Petr Uzel
2011-09-19 13:29 ` [PATCH 1/7] sfdisk: file descriptor is of int type Petr Uzel
2011-09-19 13:29 ` [PATCH 2/7] sfdisk: fix weird indentation in msdos_partition() Petr Uzel
2011-09-19 13:29 ` [PATCH 3/7] sfdisk: make the cylinder boundary check less fatal Petr Uzel
2011-09-19 13:29 ` [PATCH 4/7] sfdisk: get_disksize() returns long long Petr Uzel
2011-09-19 13:29 ` [PATCH 5/7] sfdisk: introduce get_ull() function Petr Uzel
2011-09-19 13:29 ` [PATCH 6/7] sfdisk: use unsigned long long to internally represent sector number Petr Uzel
2011-09-19 13:29 ` [PATCH 7/7] sfdisk: warn if partition exceeds partition table limits Petr Uzel
2011-09-27 13:35 ` [PATCH 0/7] sfdisk improvements Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).