bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] libparted: remove now-worse-than-useless _kernel_reread_part_tab


From: Jim Meyering
Subject: [PATCH] libparted: remove now-worse-than-useless _kernel_reread_part_table
Date: Fri, 30 Apr 2010 14:42:40 +0200

Does anyone know of a reason to retain this function?
Currently it is producing unwarranted failures,
and removing it causes no problem I can see.

If you know of a case where it's required, please
outline it in enough detail that I can reproduce it --
then I'll add a test case for it.


>From 1bbd893f6031ec16b3c152877289c90f2ea8e8d0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 30 Apr 2010 11:45:51 +0200
Subject: [PATCH] libparted: remove now-worse-than-useless 
_kernel_reread_part_table

Now that we're using BLKPG properly, there's no point in using the
less-functional BLKRRPART ioctl to make the kernel reread the partition
table.
* libparted/arch/linux.c (_kernel_reread_part_table): Remove function.
(linux_disk_commit): Don't call it.
---
 libparted/arch/linux.c |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 988fde7..d8f3393 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2760,34 +2760,6 @@ _dm_reread_part_table (PedDisk* disk)
 #endif

 static int
-_kernel_reread_part_table (PedDevice* dev)
-{
-        LinuxSpecific*  arch_specific = LINUX_SPECIFIC (dev);
-        int             retry_count = 9;
-
-        sync();
-        while (ioctl (arch_specific->fd, BLKRRPART)) {
-                retry_count--;
-                sync();
-                if (retry_count == 3)
-                        sleep(1); /* Pause to allow system to settle */
-
-                if (!retry_count) {
-                        ped_exception_throw (
-                                PED_EXCEPTION_WARNING,
-                                PED_EXCEPTION_IGNORE,
-                        _("WARNING: the kernel failed to re-read the partition 
"
-                          "table on %s (%s).  As a result, it may not "
-                          "reflect all of your changes until after reboot."),
-                                dev->path, strerror (errno));
-                        return 0;
-                }
-        }
-
-        return 1;
-}
-
-static int
 _have_blkpg ()
 {
         static int have_blkpg = -1;
@@ -2825,8 +2797,6 @@ linux_disk_commit (PedDisk* disk)
                          ok = 0;
                }

-               if (!_kernel_reread_part_table (disk->dev))
-                       ok = 0;
                 return ok;
         }

--
1.7.1.328.g9993c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]