diff options
author | Phillip Susi <psusi@ubuntu.com> | 2013-12-23 15:28:22 -0500 |
---|---|---|
committer | Phillip Susi <psusi@ubuntu.com> | 2014-03-05 20:44:57 -0500 |
commit | 026736e9fed89ef00e6e6e84c7e422639ac2715c (patch) | |
tree | fbf50e4f80db8932c6767182ad0b53a2ebb3801f | |
parent | 80f4f42c805ee37392c5cc43d8ac08772b7b1cf1 (diff) | |
download | parted-026736e9fed89ef00e6e6e84c7e422639ac2715c.tar.gz |
libparted: sync partitions > 16
The linux partition sync code was hard coded to only flush
the first 16 partitions.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | libparted/arch/linux.c | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -23,6 +23,8 @@ GNU parted NEWS -*- outline -*- ** Bug Fixes + Fix linux partition sync code to flush partitions > 16 + Do not reject a FAT boot sector as invalid because it has no system ID string. diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 4376d17..71f5034 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -289,6 +289,8 @@ struct blkdev_ioctl_param { static char* _device_get_part_path (PedDevice const *dev, int num); static int _partition_is_mounted_by_path (const char* path); +static unsigned int _device_get_partition_range(PedDevice const* dev); + static int _read_fd (int fd, char **buf) @@ -1581,6 +1583,7 @@ _flush_cache (PedDevice* dev) { LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); int i; + int lpn = _device_get_partition_range(dev); if (dev->read_only) return; @@ -1588,7 +1591,7 @@ _flush_cache (PedDevice* dev) ioctl (arch_specific->fd, BLKFLSBUF); - for (i = 1; i < 16; i++) { + for (i = 1; i < lpn; i++) { char* name; int fd; |