HomeFreeBSD

fix locking in zfsctl_root_lookup

Description

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

Details

Provenance
avgAuthored on
Parents
rS299946: gfs_lookup_dot() does not have to acquire any locks
Branches
Unknown
Tags
Unknown