Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 2020 12:34:49 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r367631 - in head/sys: kern sys
Message-ID:  <X65hScuwSUrJrKJh@kib.kiev.ua>
In-Reply-To: <202011130931.0AD9VwBL082843@repo.freebsd.org>
References:  <202011130931.0AD9VwBL082843@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 13, 2020 at 09:31:58AM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Fri Nov 13 09:31:57 2020
> New Revision: 367631
> URL: https://svnweb.freebsd.org/changeset/base/367631
> 
> Log:
>   Implement vn_lock_pair().
>   
>   In collaboration with:	pho
>   Reviewed by:	mckusick (previous version), markj (previous version)
>   Tested by:	markj (syzkaller), pho
>   Sponsored by:	The FreeBSD Foundation
>   Differential revision:	https://reviews.freebsd.org/D26136
> 
> Modified:
>   head/sys/kern/vfs_vnops.c
>   head/sys/sys/vnode.h
> 
> Modified: head/sys/kern/vfs_vnops.c
> ==============================================================================
> --- head/sys/kern/vfs_vnops.c	Fri Nov 13 02:05:45 2020	(r367630)
> +++ head/sys/kern/vfs_vnops.c	Fri Nov 13 09:31:57 2020	(r367631)
> @@ -275,6 +276,10 @@ restart:
>  			vn_finished_write(mp);
>  			if (error) {
>  				NDFREE(ndp, NDF_ONLY_PNBUF);
> +				if (error == ERELOOKUP) {
> +					NDREINIT(ndp);
> +					goto restart;
> +				}
>  				return (error);
>  			}
>  			fmode &= ~O_TRUNC;
> @@ -1524,6 +1529,7 @@ vn_truncate(struct file *fp, off_t length, struct ucre
>  
>  	vp = fp->f_vnode;
>  
> +retry:
>  	/*
>  	 * Lock the whole range for truncation.  Otherwise split i/o
>  	 * might happen partly before and partly after the truncation.
> @@ -1550,6 +1556,8 @@ out:
>  	vn_finished_write(mp);
>  out1:
>  	vn_rangelock_unlock(vp, rl_cookie);
> +	if (error == ERELOOKUP)
> +		goto retry;
>  	return (error);
>  }
These chunks really belong to r367632 and not r367631, they leaked there
due to my mishandling of the split.  I am sorry for that, but I do not think
it is reasonable to revert and re-commit.



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