From 57ca7c831cd231f56502d0aa5a4d042a48f5894e Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Mon, 18 Jan 2016 20:53:22 +0100 Subject: NetBSD regression reliability: properly cleanup loopback devices When a loopback device is configured and we forcibly unmount the filesystem containing the backing store, further vnconfig -l will complain "vnconfig: VNDIOCGET: Bad file descriptor" causing failures. We fix this by iterating on all loopback devices available in /dev, testing for this condition and manually unconfiguring when it happens. Backport of: I17b956a8ed28a7767f2d0dda83b93c523d3238c2 BUG: 1212676 Change-Id: I9d6fdd859572b653e1144c7d9d98a977cc3e255a Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/13205 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri CentOS-regression: Gluster Build System --- tests/include.rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/include.rc b/tests/include.rc index dd64f4c74f8..8b5dea9b013 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -427,6 +427,12 @@ function cleanup() done ;; NetBSD) + # cleanup loopback device with unmounted backing store + for vnd in /dev/vnd* ; do + vnconfig -l ${vnd} 2>&1 | \ + grep -q 'Bad file descriptor' && vnconfig -u ${vnd} + done + vnd=`vnconfig -l | \ awk '!/not in use/{printf("%s%s:%d ", $1, $2, $5);}'` for l in ${vnd} ; do -- cgit