#4 — zfs-fuse not releasing device mapper devfiles after offline or export
| State | Resolved |
|---|---|
| Version: | 0.6.0 |
| Area | Functionality |
| Issue type | Bug |
| Severity | Important |
| Submitted by | Rudd-O |
| Submitted on | Nov 25, 2009 |
| Responsible | Seth Heeren |
| Target release: | 0.6.9 |
Last modified on
May 22, 2010
by
Seth Heeren
Details here
http://groups.google.com/[…]/c608287e4ece93fd?hl=en
http://zfs-fuse.sehe.nl/?p=[…]362bbbbc80dc8260d77d9b930a5
http://groups.google.com/[…]/c608287e4ece93fd?hl=en
http://zfs-fuse.sehe.nl/?p=[…]362bbbbc80dc8260d77d9b930a5
- Steps to reproduce:
- lvcreate -L5g -n z1 media
lvcreate -L5g -n z2 media
cryptsetup -v luksFormat /dev/media/z1
cryptsetup -v luksFormat /dev/media/z2
dmsetup info media-z1
dmsetup info media-z2
zfs-fuse
zpool create crypt mirror /dev/media/z[12]
zpool status
zpool offline crypt /dev/media/z2
zpool status
fuser -v /dev/media/z[12]
lsof /dev/media/z[12]
# both showed both devs in use by zfs-fuse
zfs umount -a
fuser -v /dev/media/z[12]
lsof /dev/media/z[12]
# no change
zpool export crypt
zpool status
fuser -v /dev/media/z[12]
# WEIRD: only z2 still in use
Added by
Seth Heeren
on
Nov 25, 2009 07:02 PM
Issue state:
unconfirmed → resolved
Severity:
Important → Medium
Target release:
None → 0.6.0
Responsible manager:
(UNASSIGNED) → RuddO
I just found the cause for this bug. It was introduced in hg commit
Wilson 10850:6840704 osol_0906 PV guests sometimes hang at login prompt
It introduced checking a reopening flag to avoid closing a vdev if it was being reopened. This flag is being inappropriately propagated from the parent vdev to the child vdev if the parent is being reopened, with the child being offlined.
My fix is available in my stable branch (git://zfs-fuse.sehe.nl/git/zfs-fuse), and here:
diff --git a/src/lib/libzpool/vdev.c b/src/lib/libzpool/vdev.c
index c22a614..263500d 100644
--- a/src/lib/libzpool/vdev.c
+++ b/src/lib/libzpool/vdev.c
@@ -1363,7 +1363,10 @@ vdev_close(vdev_t *vd)
ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL);
if (pvd != NULL && pvd->vdev_reopening)
- vd->vdev_reopening = pvd->vdev_reopening;
+ {
+ // avoid reopening the vdev if it should go offline anyway
+ vd->vdev_reopening = vd->vdev_offline? B_FALSE : pvd->vdev_reopening;
+ }
vd->vdev_ops->vdev_op_close(vd);
Wilson 10850:6840704 osol_0906 PV guests sometimes hang at login prompt
It introduced checking a reopening flag to avoid closing a vdev if it was being reopened. This flag is being inappropriately propagated from the parent vdev to the child vdev if the parent is being reopened, with the child being offlined.
My fix is available in my stable branch (git://zfs-fuse.sehe.nl/git/zfs-fuse), and here:
diff --git a/src/lib/libzpool/vdev.c b/src/lib/libzpool/vdev.c
index c22a614..263500d 100644
--- a/src/lib/libzpool/vdev.c
+++ b/src/lib/libzpool/vdev.c
@@ -1363,7 +1363,10 @@ vdev_close(vdev_t *vd)
ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL);
if (pvd != NULL && pvd->vdev_reopening)
- vd->vdev_reopening = pvd->vdev_reopening;
+ {
+ // avoid reopening the vdev if it should go offline anyway
+ vd->vdev_reopening = vd->vdev_offline? B_FALSE : pvd->vdev_reopening;
+ }
vd->vdev_ops->vdev_op_close(vd);
Added by
Seth Heeren
on
Nov 25, 2009 07:09 PM
Issue state:
resolved → open
Changing status pending merge with official repo
Added by
Seth Heeren
on
Dec 05, 2009 06:29 PM
To the best of my knowledge, my patch has been merged into Emanuels new-master branch for some while now
Is there any time estimate we can get on this for merging it into official?
Is there any time estimate we can get on this for merging it into official?
Added by
Rudd-O
on
Dec 05, 2009 09:24 PM
Severity:
Medium → Important
Tomorrow i hace some time. Let's hope I can make it.
Added by
Emmanuel Anne
on
Dec 10, 2009 07:42 AM
Fixed at least in Seth's repo and mine (master branch).
http://rainemu.swishparty.co.uk/[…]/gitweb.cgi?p=zfs;a=summary
http://rainemu.swishparty.co.uk/[…]/gitweb.cgi?p=zfs;a=summary
Added by
Seth Heeren
on
May 22, 2010 01:43 PM
Issue state:
open → resolved
Target release:
0.6.0 → 0.6.9
Responsible manager:
RuddO → sgheeren
eventual fix merged from upstream
closing
closing

