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
This commit is contained in:
Mike Fleetwood 2013-11-22 13:10:26 +00:00
parent 4d7ebe0314
commit 4202992063
1 changed files with 1 additions and 4 deletions

View File

@ -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(),