[gparted] Fix false busy detection of unusual case with Linux Software RAID (#712533)



commit 420299206323fb49da5ba099b9f51cba95e58603
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri Nov 22 13:10:26 2013 +0000

    Fix false busy detection of unusual case with Linux Software RAID (#712533)
    
    In this unusual setup of having one Linux Software RAID array
    partitioned and a second array not partitioned, /dev/md1p1 partition in
    the first array is falsely reported as busy when the file system filling
    the second array /dev/md2 is mounted.
    
      Partition   RAID                File System        Mount mount
      ---------   -----------------   ----------------   -----------
      /dev/sdb1   SWRAID /dev/md1
                         /dev/md1p1   ext4,Label=test1   (Unmounted)
      /dev/sdb2   SWRAID /dev/md2     ext4,Label=test2   /mnt/2
    
    This again affects Debian 6, Debian 7 and RHEL/CentOS 6.x and is as a
    result of the this bug fixed in libparted 2.4:
        http://git.savannah.gnu.org/cgit/parted.git/commit/?id=db52898c214310dab4ed84e6cb2f9ffc8c3aa502
        linux: also detect "in-use" dmraid and scsi-Nth (N>=16) partition
    
    Fix by not using libparted's ped_partition_is_busy() to determine if a
    normal or logical partition is busy.
    
    Bug #712533 - Partitions not detected as busy inside Software RAID on
                  some distros

 src/GParted_Core.cc |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 54743b4..67d076a 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -1054,16 +1054,13 @@ void GParted_Core::set_device_partitions( Device & device, PedDevice* lp_device,
                                {
                                        //Determine if partition is busy:
                                        //  1st search GParted internal mounted partitions map;
-                                       //  2nd custom checks for none file system partitions;
-                                       //  3rd use libparted.
+                                       //  2nd custom checks for none file system partitions.
                                        iter_mp = mount_info .find( partition_path ) ;
                                        if ( iter_mp != mount_info .end() )
                                                partition_is_busy = true ;
 
                                        partition_is_busy |=    ( filesystem == FS_LVM2_PV      && 
lvm2_pv_info .has_active_lvs( partition_path ) )
                                                             || ( filesystem == FS_LINUX_SWRAID && 
Utils::swraid_member_is_active( partition_path ) ) ;
-
-                                       partition_is_busy |= ped_partition_is_busy( lp_partition ) ;
                                }
 
                                partition_temp .Set( device .get_path(),


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