From c8bbb0c93d3d91fe73c8635c655ddae031ecd474 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Tue, 15 Sep 2020 18:40:03 -0400 Subject: [PATCH] Linux: Prevent destruction while showing mount devname Use ZFS_ENTER and ZFS_EXIT to protect datasets while their mount devname is being retrieved. Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10892 Closes #10927 --- module/os/linux/zfs/zpl_super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/os/linux/zfs/zpl_super.c b/module/os/linux/zfs/zpl_super.c index 333c647466..ec88afee90 100644 --- a/module/os/linux/zfs/zpl_super.c +++ b/module/os/linux/zfs/zpl_super.c @@ -187,10 +187,12 @@ __zpl_show_devname(struct seq_file *seq, zfsvfs_t *zfsvfs) { char *fsname; + ZFS_ENTER(zfsvfs); fsname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); dmu_objset_name(zfsvfs->z_os, fsname); seq_puts(seq, fsname); kmem_free(fsname, ZFS_MAX_DATASET_NAME_LEN); + ZFS_EXIT(zfsvfs); return (0); }