]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fix locking in zfsctl_root_lookup
authorAndriy Gapon <avg@FreeBSD.org>
Mon, 16 May 2016 15:28:39 +0000 (15:28 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Mon, 16 May 2016 15:28:39 +0000 (15:28 +0000)
commit0ab1aa90fa6cdfac63ba895c6862ca2d68ab7719
tree7f493cd017d27b533f72ce53dc4bf7f5e1aa09e5
parent705e6b8170949d712535ddeae40e8912c4498b43
fix locking in zfsctl_root_lookup

Dropping the root vnode's lock after VFS_ROOT() didn't really help the
fact that we acquired the lock while holding its child's, .zfs, lock
while performing the operaiton.
So, directly use zfs_zget() to get the root vnode.

While there simplify the code in zfsctl_freebsd_root_lookup.
We know that .zfs is always exclusively locked.
We know that there is already a reference on *vpp, so no need for an
extra one.
Account for the fact that .. lookup may ask for a different lock type,
not necessarily LK_EXCLUSIVE.  And handle a possible failure to acquire
the lock given the lock flags.

MFC after: 5 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c