Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919696 - sys-fs/zfs-2.2.2: init script "zfs-import" doesn't implement stop() and can't properly deactivate zpool during shutdown
Summary: sys-fs/zfs-2.2.2: init script "zfs-import" doesn't implement stop() and can't...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sam James
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-12-10 22:38 UTC by ev
Modified: 2024-02-14 10:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch adding stop() to /etc/init.d/zfs-import (zfs-2.2.2-zfs-import-stop-fix.patch,1.19 KB, patch)
2023-12-10 22:38 UTC, ev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ev 2023-12-10 22:38:53 UTC
Created attachment 878653 [details, diff]
patch adding stop() to /etc/init.d/zfs-import

ZFS zfs-import doesn't have stop() functionality and cannot properly unmount zpool (zfs export -a).

This causes a lot of error if zfs pool is on dmcrypt encrypted devices.
Zfs still holds block devices because pool is imported and dmcrypt cannot close them. 

Example
 *   crypt15 ...
device-mapper: remove ioctl on crypt15  failed: Device or resource busy
device-mapper: remove ioctl on crypt15  failed: Device or resource busy
device-mapper: remove ioctl on crypt15  failed: Device or resource busy
...
device-mapper: remove ioctl on crypt15  failed: Device or resource busy
device-mapper: remove ioctl on crypt15  failed: Device or resource busy
Device crypt15 is still in use.
 [ !! ]


Dmcrypt errors significantly prolong shutdowns and reboots if system has a lot of encrypted drives.

I'm attaching a patch which adds zfs-import stop() and I'll try to send it upstream.

You may consider disabling ZPOOL_EXPORT='yes' by default just like ZFS_UNMOUNT to avoid hitting bug https://bugs.gentoo.org/647688. 
(My patch has this option enabled to be consistent with upstream code)