Project

General

Profile

Actions

Bug #3170

open

"zfs destroy" does not remove device nodes of zvol snapshots

Added by Martin Matuška over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2012-09-08
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

Changeset 13524:f0e12b33f77c has broken the removal of device nodes of zvol snapshots.

Steps to reproduce:

zvol create -V 64M rpool/testvol
zfs snapshot rpool/testvol@s1
zfs destroy rpool/testvol@s1
ls -l /dev/zvol/*/rpool/testvol@s1

Brian Behlendorf <> (working on the zfsonlinux project) suggests the following fix:

diff -r 89bb108e9ab6 usr/src/uts/common/fs/zfs/zfs_ioctl.c
--- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c     Tue Sep 04 12:05:09 2012 +0000
+++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c     Sat Sep 08 10:32:04 2012 +0200
@@ -3399,6 +3399,7 @@
                 * will deal with this gracefully (by filling in outnvl).
                 */
                (void) zfs_unmount_snap(name, NULL);
+               (void) zvol_remove_minor(name);
        }

        return (dmu_snapshots_destroy_nvl(snaps, defer, outnvl));

References to zfsonlinux issue, pull request and commit:
https://github.com/zfsonlinux/zfs/issues/903
https://github.com/zfsonlinux/zfs/pull/946
https://github.com/behlendorf/zfs/commit/142ac15fe51682dd002a799cf5f16a4fffdae250

Actions #1

Updated by Martin Matuška over 10 years ago

Here is fixed reproduction:

zfs create -V 64M rpool/testvol
zfs snapshot rpool/testvol@s1
zfs destroy rpool/testvol@s1
ls -l /dev/zvol/*/rpool/testvol@s1

Actions

Also available in: Atom PDF