[gparted] Tighten up regexp for HP Smart Array Devices
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Tighten up regexp for HP Smart Array Devices
- Date: Thu, 6 Dec 2012 00:25:48 +0000 (UTC)
commit f003b3c4f2613a70011c5fe4ba850f90c24d7e2c
Author: Curtis Gedak <gedakc gmail com>
Date: Wed Nov 14 11:57:53 2012 -0700
Tighten up regexp for HP Smart Array Devices
HP Smart Array Devices are listed in /proc/partitions as follows:
major minor #blocks name
104 0 143338560 cciss/c0d0
104 1 104391 cciss/c0d0p1
104 2 24097 cciss/c0d0p2
104 3 143203410 cciss/c0d0p3
The previous regular expression was too broad, and would match many
other forms, including Linux software RAID devices such as md127.
Linux software RAID devices are listed in /proc/partitions as follows:
major minor #blocks name
9 127 523968 md127
259 0 131072 md127p1
259 1 262144 md127p2
This problem with the regexp was discovered while investigating a
problem with Linux software RAID device detection.
The regular expression has been tightened up to match the following
hardware RAID controllers:
Compaq/HP Smartarray RAID controller
E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
(linux-x.y.z/Documentation/blockdev/cciss.txt)
Compaq SMART2 Intelligent Disk Array controller
E.g., device = /dev/ida/c0d0, partition = /dev/ida/c0d0p1
(linux-x.y.z/Documentation/blockdev/cpqarray.txt)
Mylex DAC960/AcceleRAID/eXtremeRAID PCI RAID Controllers
E.g., device = /dev/rd/c0d0, partition = /dev/rd/c0d0p1
(linux-x.y.z/Documentation/blockdev/README.DAC960)
Related to Bug #678379 - Could not stat device /dev/md/0 - No such
file or directory
src/Proc_Partitions_Info.cc | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/Proc_Partitions_Info.cc b/src/Proc_Partitions_Info.cc
index f5490cc..d0e2a5d 100644
--- a/src/Proc_Partitions_Info.cc
+++ b/src/Proc_Partitions_Info.cc
@@ -97,9 +97,16 @@ void Proc_Partitions_Info::load_proc_partitions_info_cache()
if ( device == "" )
device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(mmcblk[0-9]+)$") ;
//Device names that end with a #[^p]# are HP Smart Array Devices (disks)
- //E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
+ // E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
+ // (linux-x.y.z/Documentation/blockdev/cciss.txt)
+ //Device names for Compaq SMART2 Intelligent Disk Array
+ // E.g., device = /dev/ida/c0d0, partition = /dev/ida/c0d0p1
+ // (linux-x.y.z/Documentation/blockdev/cpqarray.txt)
+ //Device names for Mylex DAC960/AcceleRAID/eXtremeRAID PCI RAID
+ // E.g., device = /dev/rd/c0d0, partition = /dev/rd/c0d0p1
+ // (linux-x.y.z/Documentation/blockdev/README.DAC960)
if ( device == "" )
- device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(.*[0-9]+[^p]{1}[0-9]+)$") ;
+ device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+([a-z]+/c[0-9]+d[0-9]+)$") ;
if ( device != "" )
{
//add potential device to the list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]