* [PATCH] common: make sure dm error device is all settled before removing it
@ 2016-03-24 12:08 Eryu Guan
2016-03-24 12:34 ` Filipe Manana
2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan
0 siblings, 2 replies; 4+ messages in thread
From: Eryu Guan @ 2016-03-24 12:08 UTC (permalink / raw)
To: fstests; +Cc: Eryu Guan
_dmerror_cleanup() may fail to remove error-test device due to EBUSY and
cause subsequent tests to fail.
Fix it by calling $UDEV_SETTLE_PROG before remove error-test device to
make sure no one is using it.
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
common/dmerror | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/dmerror b/common/dmerror
index 004530d..5d2c1b6 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -54,6 +54,9 @@ _dmerror_unmount()
_dmerror_cleanup()
{
$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+ # wait for device to be fully settled so that 'dmsetup remove' doesn't
+ # fail due to EBUSY
+ $UDEV_SETTLE_PROG >/dev/null 2>&1
$DMSETUP_PROG remove error-test > /dev/null 2>&1
}
--
2.5.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] common: make sure dm error device is all settled before removing it
2016-03-24 12:08 [PATCH] common: make sure dm error device is all settled before removing it Eryu Guan
@ 2016-03-24 12:34 ` Filipe Manana
2016-03-24 13:17 ` Eryu Guan
2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan
1 sibling, 1 reply; 4+ messages in thread
From: Filipe Manana @ 2016-03-24 12:34 UTC (permalink / raw)
To: Eryu Guan; +Cc: fstests
On Thu, Mar 24, 2016 at 12:08 PM, Eryu Guan <eguan@redhat.com> wrote:
> _dmerror_cleanup() may fail to remove error-test device due to EBUSY and
> cause subsequent tests to fail.
>
> Fix it by calling $UDEV_SETTLE_PROG before remove error-test device to
> make sure no one is using it.
I often get the same problem with _cleanup_flakey.
Would you be doing the same for flakey in this or another patch?
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
> ---
> common/dmerror | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/common/dmerror b/common/dmerror
> index 004530d..5d2c1b6 100644
> --- a/common/dmerror
> +++ b/common/dmerror
> @@ -54,6 +54,9 @@ _dmerror_unmount()
> _dmerror_cleanup()
> {
> $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
> + # wait for device to be fully settled so that 'dmsetup remove' doesn't
> + # fail due to EBUSY
> + $UDEV_SETTLE_PROG >/dev/null 2>&1
> $DMSETUP_PROG remove error-test > /dev/null 2>&1
> }
>
> --
> 2.5.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] common: make sure dm error device is all settled before removing it
2016-03-24 12:34 ` Filipe Manana
@ 2016-03-24 13:17 ` Eryu Guan
0 siblings, 0 replies; 4+ messages in thread
From: Eryu Guan @ 2016-03-24 13:17 UTC (permalink / raw)
To: Filipe Manana; +Cc: fstests
On Thu, Mar 24, 2016 at 12:34:55PM +0000, Filipe Manana wrote:
> On Thu, Mar 24, 2016 at 12:08 PM, Eryu Guan <eguan@redhat.com> wrote:
> > _dmerror_cleanup() may fail to remove error-test device due to EBUSY and
> > cause subsequent tests to fail.
> >
> > Fix it by calling $UDEV_SETTLE_PROG before remove error-test device to
> > make sure no one is using it.
>
> I often get the same problem with _cleanup_flakey.
> Would you be doing the same for flakey in this or another patch?
I'm going to fix them in one patch.
>
> >
> > Signed-off-by: Eryu Guan <eguan@redhat.com>
>
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
Eryu
>
> > ---
> > common/dmerror | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/common/dmerror b/common/dmerror
> > index 004530d..5d2c1b6 100644
> > --- a/common/dmerror
> > +++ b/common/dmerror
> > @@ -54,6 +54,9 @@ _dmerror_unmount()
> > _dmerror_cleanup()
> > {
> > $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
> > + # wait for device to be fully settled so that 'dmsetup remove' doesn't
> > + # fail due to EBUSY
> > + $UDEV_SETTLE_PROG >/dev/null 2>&1
> > $DMSETUP_PROG remove error-test > /dev/null 2>&1
> > }
> >
> > --
> > 2.5.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe fstests" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Filipe David Manana,
>
> "Reasonable men adapt themselves to the world.
> Unreasonable men adapt the world to themselves.
> That's why all progress depends on unreasonable men."
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] common: make sure dm device is all settled before removing it
2016-03-24 12:08 [PATCH] common: make sure dm error device is all settled before removing it Eryu Guan
2016-03-24 12:34 ` Filipe Manana
@ 2016-03-24 13:25 ` Eryu Guan
1 sibling, 0 replies; 4+ messages in thread
From: Eryu Guan @ 2016-03-24 13:25 UTC (permalink / raw)
To: fstests; +Cc: Eryu Guan
_dmerror_cleanup()/_cleanup_flakey may fail to remove dm device due to
EBUSY and cause subsequent tests to fail.
Fix it by calling $UDEV_SETTLE_PROG before remove dm device to make sure
no one is using it.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
v2:
- fix _cleanup_flakey() as well, thanks to Filipe for pointing it out
common/dmerror | 3 +++
common/dmflakey | 3 +++
2 files changed, 6 insertions(+)
diff --git a/common/dmerror b/common/dmerror
index 004530d..5d2c1b6 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -54,6 +54,9 @@ _dmerror_unmount()
_dmerror_cleanup()
{
$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+ # wait for device to be fully settled so that 'dmsetup remove' doesn't
+ # fail due to EBUSY
+ $UDEV_SETTLE_PROG >/dev/null 2>&1
$DMSETUP_PROG remove error-test > /dev/null 2>&1
}
diff --git a/common/dmflakey b/common/dmflakey
index 3b6521a..4434307 100644
--- a/common/dmflakey
+++ b/common/dmflakey
@@ -54,6 +54,9 @@ _cleanup_flakey()
# otherwise the umount will hang
$DMSETUP_PROG resume flakey-test > /dev/null 2>&1
$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+ # wait for device to be fully settled so that 'dmsetup remove' doesn't
+ # fail due to EBUSY
+ $UDEV_SETTLE_PROG >/dev/null 2>&1
$DMSETUP_PROG remove flakey-test > /dev/null 2>&1
$DMSETUP_PROG mknodes > /dev/null 2>&1
}
--
2.5.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-24 13:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 12:08 [PATCH] common: make sure dm error device is all settled before removing it Eryu Guan
2016-03-24 12:34 ` Filipe Manana
2016-03-24 13:17 ` Eryu Guan
2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox