[PATCH] Resolve /dev/md/ symlinks when checking swap status.

Brian C. Lane bcl at redhat.com
Mon Apr 20 23:18:58 UTC 2015


On Mon, Apr 20, 2015 at 01:03:24PM -0500, David Lehman wrote:
> Related: #1212073
> ---
>  src/plugins/swap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/plugins/swap.c b/src/plugins/swap.c
> index ba97fbd..49d47e7 100644
> --- a/src/plugins/swap.c
> +++ b/src/plugins/swap.c
> @@ -223,7 +223,7 @@ gboolean bd_swap_swapstatus (gchar *device, GError **error) {
>  
>      /* get the real device node for device-mapper devices since the ones
>         with meaningful names are just symlinks */
> -    if (g_str_has_prefix (device, "/dev/mapper")) {
> +    if (g_str_has_prefix (device, "/dev/mapper") || g_str_has_prefix (device, "/dev/md/")) {

Maybe also make that "/dev/mapper/"? It should probably also include the
/ just to be sure.

Ack either way.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list