forked from pool/parted
- Drop using deprecated configure option "--disable-Werror" - Drop (SUSE specific) support for hybrid pMBR (gpt_sync_mbr label) (fate#317849, bsc#1041322) - remove: parted-gpt-mbr-sync.patch - remove: libparted-ppc-prepboot-in-syncmbr.patch - remove: parted-workaround-windows7-gpt-implementation.patch - refresh patches - libparted: Fix starting CHS in protective MBR (bsc#969165) - add: libparted-fix-starting-CHS-in-protective-MBR.patch OBS-URL: https://build.opensuse.org/request/show/519106 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=132
47 lines
1.4 KiB
Diff
47 lines
1.4 KiB
Diff
---
|
|
libparted/arch/linux.c | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
--- a/libparted/arch/linux.c
|
|
+++ b/libparted/arch/linux.c
|
|
@@ -39,6 +39,7 @@
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
#include <sys/utsname.h> /* for uname() */
|
|
+#include <sys/file.h>
|
|
#include <scsi/scsi.h>
|
|
#include <assert.h>
|
|
#ifdef ENABLE_DEVICE_MAPPER
|
|
@@ -3102,14 +3103,15 @@ static int
|
|
_kernel_reread_part_table (PedDevice* dev)
|
|
{
|
|
LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
|
|
- int retry_count = 9;
|
|
+ int retry_count = 5;
|
|
|
|
sync();
|
|
+ flock(arch_specific->fd, LOCK_EX);
|
|
while (ioctl (arch_specific->fd, BLKRRPART)) {
|
|
retry_count--;
|
|
sync();
|
|
- if (retry_count == 3)
|
|
- sleep(1); /* Pause to allow system to settle */
|
|
+
|
|
+ sleep(1); /* Pause to allow system to settle */
|
|
|
|
if (!retry_count) {
|
|
ped_exception_throw (
|
|
@@ -3119,10 +3121,12 @@ _kernel_reread_part_table (PedDevice* de
|
|
"table on %s (%s). As a result, it may not "
|
|
"reflect all of your changes until after reboot."),
|
|
dev->path, strerror (errno));
|
|
+ flock(arch_specific->fd, LOCK_UN);
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+ flock(arch_specific->fd, LOCK_UN);
|
|
return 1;
|
|
}
|
|
|