HomeFreeBSD

avoid deadlock between zfsctl_snapdir_lookup and zfsctl_snapshot_reclaim

Description

avoid deadlock between zfsctl_snapdir_lookup and zfsctl_snapshot_reclaim

The former acquired a snap vnode lock while holding sd_lock while the
latter does the opposite.

The solution is drop sd_lock before acquiring the vnode lock. That
should be okay as we are still holding a lock on the 'snapshot'
directory in the exclusive mode. That lock ensures that there are no
concurrent lookups in the directory and thus no concurrent mount attempts.

But now we have to account for the possibility that the snap vnode
might get reclaim after we drop sd_lock and before we can get
the node lock. So, check for that case and retry.

MFC after: 5 weeks

Details

Provenance
avgAuthored on
Parents
rS299944: Add intrng support to the GICv3 driver. It lacks ITS support so won't handle
Branches
Unknown
Tags
Unknown