Display correct type of mdadm recognised ATARAID members (#75)

The previous commit, made mdadm recognised IMSM and DDF type ATARAID
members get displayed as "linux-raid" (Linux Software RAID array
member).  This was because of query method 1 in detect_filesystems().

Fix this now by exposing and using the fstype of the member from the
SWRaid_Info cache.

Closes #75 - Errors with GPT on RAID 0 ATARAID array
This commit is contained in:
Mike Fleetwood 2019-11-17 16:19:39 +00:00 committed by Curtis Gedak
parent 73bf8bef62
commit ef6794b7de
3 changed files with 13 additions and 2 deletions

View File

@ -58,6 +58,7 @@ public:
static void load_cache();
static bool is_member( const Glib::ustring & member_path );
static bool is_member_active( const Glib::ustring & member_path );
static FSType get_fstype(const Glib::ustring& member_path);
static Glib::ustring get_array( const Glib::ustring & member_path );
static Glib::ustring get_uuid( const Glib::ustring & member_path );
static Glib::ustring get_label( const Glib::ustring & member_path );

View File

@ -1202,9 +1202,9 @@ FSType GParted_Core::detect_filesystem( PedDevice * lp_device, PedPartition * lp
// (Q4) internal
path = lp_device->path;
// (Q1) Linux Software RAID member detection
// (Q1) SWRaid_Info (mdadm) member detection.
if ( SWRaid_Info::is_member( path ) )
return FS_LINUX_SWRAID;
return SWRaid_Info::get_fstype(path);
// (Q2) FS_Info (blkid) file system detection
// Blkid detects more signatures and generally has less limitations so use before

View File

@ -74,6 +74,16 @@ bool SWRaid_Info::is_member_active( const Glib::ustring & member_path )
return memb.active;
}
// Return "file system" type of the member, or FS_UNKNOWN if there is no such member.
FSType SWRaid_Info::get_fstype(const Glib::ustring& member_path)
{
initialise_if_required();
const SWRaid_Member& memb = get_cache_entry_by_member(member_path);
return memb.fstype;
}
// Return array /dev entry (e.g. "/dev/md1") containing the specified member, or "" if the
// array is not running or there is no such member.
Glib::ustring SWRaid_Info::get_array( const Glib::ustring & member_path )