Linux Device Mapper development
 help / color / mirror / Atom feed
From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: Stef Walter <stefw@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH 1/1] kpartx: Use absolute paths to create mappings
Date: Tue, 9 Oct 2018 18:21:19 -0500	[thread overview]
Message-ID: <20181009232119.GK3172@octiron.msp.redhat.com> (raw)
In-Reply-To: <20181006073856.15246-2-stefw@redhat.com>

On Sat, Oct 06, 2018 at 09:38:56AM +0200, Stef Walter wrote:
> kpartx -d now uses absolute paths to delete mappings, since the
> commit 9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b. We should use
> those same absolute paths to create the mappings.
> 
> Without this patch, the following workflow (as seen in the
> manual page for kpartx) fails to actually remove the devices:
> 
>     # kpartx -av disk.img
>     ...
>     # kpartx -d disk.img

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> ---
>  kpartx/kpartx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
> index 442b6bd9..d4fb53be 100644
> --- a/kpartx/kpartx.c
> +++ b/kpartx/kpartx.c
> @@ -341,7 +341,7 @@ main(int argc, char **argv){
>  		if (!loopdev) {
>  			loopdev = find_unused_loop_device();
>  
> -			if (set_loop(loopdev, device, 0, &ro)) {
> +			if (set_loop(loopdev, rpath, 0, &ro)) {
>  				fprintf(stderr, "can't set up loop\n");
>  				exit (1);
>  			}
> -- 
> 2.17.1
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

      reply	other threads:[~2018-10-09 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-06  7:38 [PATCH 0/1] Fix kpart -d regression where matching devices not found Stef Walter
2018-10-06  7:38 ` [PATCH 1/1] kpartx: Use absolute paths to create mappings Stef Walter
2018-10-09 23:21   ` Benjamin Marzinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181009232119.GK3172@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=stefw@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox