From owner-svn-src-stable@FreeBSD.ORG Thu Jul 24 11:17:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D0C9FD3; Thu, 24 Jul 2014 11:17:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D382428; Thu, 24 Jul 2014 11:17:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OBHQp5077238; Thu, 24 Jul 2014 11:17:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OBHQLV077237; Thu, 24 Jul 2014 11:17:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407241117.s6OBHQLV077237@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Jul 2014 11:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269057 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2014 11:17:27 -0000 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; }