* [PATCH 0/1] Fix kpart -d regression where matching devices not found
@ 2018-10-06 7:38 Stef Walter
2018-10-06 7:38 ` [PATCH 1/1] kpartx: Use absolute paths to create mappings Stef Walter
0 siblings, 1 reply; 3+ messages in thread
From: Stef Walter @ 2018-10-06 7:38 UTC (permalink / raw)
To: dm-devel; +Cc: Stef Walter
The Lorax project found a regression in kpartx -d behavior introduced
by the following commit: 9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b
This patch should fix the problem. It's easy to reproduce this problem
(I did it on Fedora 28) with the following commands:
# kpartx -av disk.img
...
# kpartx -dv disk.img
Notice that the loop devices and partition mappings created by the first
command are not cleaned up by the second command.
Stef Walter (1):
kpartx: Use absolute paths to create mappings
kpartx/kpartx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 1/1] kpartx: Use absolute paths to create mappings 2018-10-06 7:38 [PATCH 0/1] Fix kpart -d regression where matching devices not found Stef Walter @ 2018-10-06 7:38 ` Stef Walter 2018-10-09 23:21 ` Benjamin Marzinski 0 siblings, 1 reply; 3+ messages in thread From: Stef Walter @ 2018-10-06 7:38 UTC (permalink / raw) To: dm-devel; +Cc: Stef Walter 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 --- 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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] kpartx: Use absolute paths to create mappings 2018-10-06 7:38 ` [PATCH 1/1] kpartx: Use absolute paths to create mappings Stef Walter @ 2018-10-09 23:21 ` Benjamin Marzinski 0 siblings, 0 replies; 3+ messages in thread From: Benjamin Marzinski @ 2018-10-09 23:21 UTC (permalink / raw) To: Stef Walter; +Cc: dm-devel 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-09 23:21 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox