]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix LORs between vn_start_write() and vn_lock() in nfsrv_copymr().
authorRick Macklem <rmacklem@FreeBSD.org>
Sat, 18 Aug 2018 19:14:06 +0000 (19:14 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Sat, 18 Aug 2018 19:14:06 +0000 (19:14 +0000)
commitfdab4d3b293953a1d0c7fce2f5683be5c8ae49a5
treef6db3410cb6ce7e3a9bf0f1ef26fb4fae71b0b88
parent067fd85894a474c7ec01a1310425a67e5658d019
Fix LORs between vn_start_write() and vn_lock() in nfsrv_copymr().

When coding the pNFS server, I added vn_start_write() calls in nfsrv_copymr()
done while the vnodes were locked, not realizing I had introduced LORs and
possible deadlock when an exported file system on the MDS is suspended.
This patch fixes the LORs by moving the vn_start_write() calls up to before
where the vnodes are locked. For "tvp", the vn_start_write() probaby isn't
necessary, because NFS mounts can't be suspended. However, I think doing
so is harmless.
Thanks go to kib@ for letting me know that I had introduced these LORs.
This patch only affects the behaviour of the pNFS server when pnfsdscopymr(8)
is used to recover a mirrored DS.
sys/fs/nfsserver/nfs_nfsdstate.c