aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2002-07-10 17:02:32 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2002-07-10 17:02:32 +0000
commitd331c5d43f198fc200938122de9a83689f2bed37 (patch)
treee267b121c9bda07891245d5c4f7da3f13b8e5cdf /sys/nfsserver
parent1116a8c98e01fd4e84a3681d86ffcc990e045996 (diff)
Notes
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 73bee420fc6d5..131c0b47041a1 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -3695,8 +3695,14 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
* If we have a buffer and it is marked B_DELWRI we
* have to lock and write it. Otherwise the prior
* write is assumed to have already been committed.
+ *
+ * gbincore() can return invalid buffers now so we
+ * have to check that bit as well (though B_DELWRI
+ * should not be set if B_INVAL is set there could be
+ * a race here since we haven't locked the buffer).
*/
- if ((bp = gbincore(vp, lblkno)) != NULL && (bp->b_flags & B_DELWRI)) {
+ if ((bp = gbincore(vp, lblkno)) != NULL &&
+ (bp->b_flags & (B_DELWRI|B_INVAL)) == B_DELWRI) {
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) {
BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL);
continue; /* retry */