aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-09-15 18:40:03 -0400
committerGitHub <[email protected]>2020-09-15 15:40:03 -0700
commit37325e47499ccdb4eeabfaa61d06a4075390b960 (patch)
treeb6aa2bd19232e58e01dae4e2d4cfbbc94a844bc8 /module
parent085321621e79a75bea41c2b6511da6ebfbf2ba0a (diff)
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 <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10892 Closes #10927
Diffstat (limited to 'module')
-rw-r--r--module/os/linux/zfs/zpl_super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/os/linux/zfs/zpl_super.c b/module/os/linux/zfs/zpl_super.c
index 333c64746..ec88afee9 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);
}