svn commit: r269057 - stable/9/sys/kern

Konstantin Belousov kib at FreeBSD.org
Thu Jul 24 11:17:27 UTC 2014


Author: kib
Date: Thu Jul 24 11:17:26 2014
New Revision: 269057
URL: http://svnweb.freebsd.org/changeset/base/269057

Log:
  MFC r268384:
  When the lock was stolen from us, retry the whole lock sequence in kernel,
  instead of returning EINTR.

Modified:
  stable/9/sys/kern/kern_lockf.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_lockf.c
==============================================================================
--- stable/9/sys/kern/kern_lockf.c	Thu Jul 24 10:45:52 2014	(r269056)
+++ stable/9/sys/kern/kern_lockf.c	Thu Jul 24 11:17:26 2014	(r269057)
@@ -469,6 +469,9 @@ lf_advlockasync(struct vop_advlockasync_
 			return (EOVERFLOW);
 		end = start + oadd;
 	}
+
+retry_setlock:
+
 	/*
 	 * Avoid the common case of unlocking when inode has no locks.
 	 */
@@ -744,6 +747,11 @@ lf_advlockasync(struct vop_advlockasync_
 		sx_destroy(&freestate->ls_lock);
 		free(freestate, M_LOCKF);
 	}
+
+	if (error == EDOOFUS) {
+		KASSERT(ap->a_op == F_SETLK, ("EDOOFUS"));
+		goto retry_setlock;
+	}
 	return (error);
 }
 
@@ -1459,7 +1467,7 @@ lf_setlock(struct lockf *state, struct l
 		lock->lf_refs++;
 		error = sx_sleep(lock, &state->ls_lock, priority, lockstr, 0);
 		if (lf_free_lock(lock)) {
-			error = EINTR;
+			error = EDOOFUS;
 			goto out;
 		}
 


More information about the svn-src-stable-9 mailing list