On Sun, Jan 03, 2010 at 01:30:56PM -0700, Curtis Gedak wrote:
> Note:  This is a repost of my email on Dec 21, 2009 which appears to
> have been held up due to the size of attachments.  As such I am
> reposting with no attachments.
> ------------------------------
> 
> 
> I am seeking help to resolve a intermittent problem when using the
> libparted library.
> 
> 
> PROBLEM
> 
> The problem is that on newer GNU/Linux distributions, the libparted
> library occasionally reports the following error message:
> 
>      The kernel was unable to re-read the partition table on /dev/sdb
>      (Device or resource busy).  This means Linux won't know anything
>      about the modifications you made until you reboot.  You should
>      reboot your computer before doing anything with /dev/sdb.
> [ .... ]

Hi,

I'm not sure, but it might be the same issue as discussed here:
https://bugzilla.novell.com/show_bug.cgi?id=539521

Comment #16 mentions two commits from parted-git; after posting this
comment, I found out that these two are not always enough to fix
the issue, so please add the quick and dirty patch attached to this
mail.

With these three patches, I was not able to reproduce -EBUSY anymore.


HTH,


-- 
Best regards / s pozdravem

Petr Uzel, openSUSE Boosters Team
-----------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: pu...@suse.cz
Lihovarská 1060/12                          http://www.suse.cz
190 00 Prague 9, CR                             
---
 libparted/arch/linux.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: parted-1.9.0/libparted/arch/linux.c
===================================================================
--- parted-1.9.0.orig/libparted/arch/linux.c	2009-12-11 12:04:43.000000000 +0100
+++ parted-1.9.0/libparted/arch/linux.c	2009-12-11 12:10:22.000000000 +0100
@@ -2224,7 +2224,9 @@ _blkpg_part_command (PedDevice* dev, str
         ioctl_arg.datalen = sizeof (struct blkpg_partition);
         ioctl_arg.data = (void*) part;
 
-        return ioctl (arch_specific->fd, BLKPG, &ioctl_arg) == 0;
+		int ret = (ioctl (arch_specific->fd, BLKPG, &ioctl_arg) == 0);
+        system("/sbin/udevadm settle");
+		return ret;
 }
 
 static int

Attachment: pgpFdyZfsI2g5.pgp
Description: PGP signature

_______________________________________________
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to