Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2014 23:31:32 +0400
From:      Andrey Chernov <ache@freebsd.org>
To:        Konstantin Belousov <kib@FreeBSD.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-stable@freebsd.org,  svn-src-stable-10@freebsd.org
Subject:   Re: svn commit: r269055 - stable/10/sys/kern
Message-ID:  <53D15F14.9010606@freebsd.org>
In-Reply-To: <201407241043.s6OAhFoF061672@svn.freebsd.org>
References:  <201407241043.s6OAhFoF061672@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 24.07.2014 14:43, Konstantin Belousov wrote:
> Author: kib
> Date: Thu Jul 24 10:43:15 2014
> New Revision: 269055
> URL: http://svnweb.freebsd.org/changeset/base/269055
> 
> Log:
>   MFC r268384:
>   When the lock was stolen from us, retry the whole lock sequence in kernel,
>   instead of returning EINTR.

Does it make dead loop possible?

> 
> Modified:
>   stable/10/sys/kern/kern_lockf.c
> Directory Properties:
>   stable/10/   (props changed)
> 
> Modified: stable/10/sys/kern/kern_lockf.c
> ==============================================================================
> --- stable/10/sys/kern/kern_lockf.c	Thu Jul 24 10:42:47 2014	(r269054)
> +++ stable/10/sys/kern/kern_lockf.c	Thu Jul 24 10:43:15 2014	(r269055)
> @@ -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;
>  		}
>  
> 


-- 
http://ache.vniz.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53D15F14.9010606>