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 <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10892 Closes #10927
This commit is contained in:
parent
085321621e
commit
37325e4749
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue