Do not obtain an already held read lock. This causes a witness panic when

ipfs is invoked. This is the second of two panics resolving PR 235110.

PR:		235110
Reported by:	David.Boyd49@twc.com
MFC after:	2 weeks
This commit is contained in:
Cy Schubert 2019-01-30 20:23:16 +00:00
parent b63abbf63a
commit b403765e8c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343591

View file

@ -1904,21 +1904,17 @@ ipf_nat_getent(softc, data, getlock)
}
}
if (error == 0) {
if (getlock) {
READ_ENTER(&softc->ipf_nat);
getlock = 0;
}
error = ipf_outobjsz(softc, data, ipn, IPFOBJ_NATSAVE,
ipns.ipn_dsize);
}
finished:
if (getlock) {
READ_ENTER(&softc->ipf_nat);
}
if (ipn != NULL) {
KFREES(ipn, ipns.ipn_dsize);
}
if (getlock) {
RWLOCK_EXIT(&softc->ipf_nat);
}
return error;
}