summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-12-07 21:16:32 +0000
committerps <ps@FreeBSD.org>2004-12-07 21:16:32 +0000
commit81f484b21d2750b85f6e9f56044348ea82792a96 (patch)
treeaf7c102f90578d85abdd0b077bf6fe263ff00008 /sys/nfsclient
parent0e900aeba092127fe706b8a59228a711b7bd683b (diff)
downloadFreeBSD-src-81f484b21d2750b85f6e9f56044348ea82792a96.zip
FreeBSD-src-81f484b21d2750b85f6e9f56044348ea82792a96.tar.gz
Fix for a Lock Order Reversal in the nfs_flush() path, between the
vnode interlock and the proc lock. Reported by: marcel Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 93d1853..68f63fd 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -2820,10 +2820,6 @@ loop:
s = splbio();
VI_LOCK(vp);
TAILQ_FOREACH_SAFE(bp, &vp->v_bufobj.bo_dirty.bv_hd, b_bobufs, nbp) {
- if (nfs_sigintr(nmp, NULL, td)) {
- error = EINTR;
- goto done;
- }
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) {
if (waitfor != MNT_WAIT || passone)
continue;
@@ -2836,6 +2832,10 @@ loop:
panic("nfs_fsync: inconsistent lock");
if (error == ENOLCK)
goto loop;
+ if (nfs_sigintr(nmp, NULL, td)) {
+ error = EINTR;
+ goto done;
+ }
if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
@@ -2856,6 +2856,10 @@ loop:
bp->b_flags |= B_ASYNC;
splx(s);
bwrite(bp);
+ if (nfs_sigintr(nmp, NULL, td)) {
+ error = EINTR;
+ goto done;
+ }
goto loop;
}
splx(s);
OpenPOWER on IntegriCloud