diff mbox

Fstests: btrfs/011 fix device mounted when tests aborts

Message ID 20180116201018.2008-1-bo.li.liu@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu Bo Jan. 16, 2018, 8:10 p.m. UTC
One of btrfs tests, btrfs/011, uses SCRATCH_DEV_POOL and puts a
non-SCRATCH_DEV device as the first one when doing mkfs, and this makes
_require_scratch{_nocheck} confused since it checks mount point with
SCRATCH_DEV only.

This adds _scratch_umount to cleanup() to umount SCRATCH_MNT by
011 itself.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 tests/btrfs/011 | 1 +
 1 file changed, 1 insertion(+)

Comments

Anand Jain Jan. 18, 2018, 2:05 p.m. UTC | #1
On 01/17/2018 04:10 AM, Liu Bo wrote:
> One of btrfs tests, btrfs/011, uses SCRATCH_DEV_POOL and puts a
> non-SCRATCH_DEV device as the first one when doing mkfs, and this makes
> _require_scratch{_nocheck} confused since it checks mount point with
> SCRATCH_DEV only.
> 
> This adds _scratch_umount to cleanup() to umount SCRATCH_MNT by
> 011 itself.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Tested-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

> ---
>   tests/btrfs/011 | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/btrfs/011 b/tests/btrfs/011
> index 28f1388..f4c5309 100755
> --- a/tests/btrfs/011
> +++ b/tests/btrfs/011
> @@ -51,6 +51,7 @@ _cleanup()
>   	fi
>   	wait
>   	rm -f $tmp.tmp
> +	_scratch_unmount > /dev/null 2>&1
>   }
>   trap "_cleanup; exit \$status" 0 1 2 3 15
>   
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/btrfs/011 b/tests/btrfs/011
index 28f1388..f4c5309 100755
--- a/tests/btrfs/011
+++ b/tests/btrfs/011
@@ -51,6 +51,7 @@  _cleanup()
 	fi
 	wait
 	rm -f $tmp.tmp
+	_scratch_unmount > /dev/null 2>&1
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15