nfs_vnops.20071117.patch

thomas.nikolajsen, 11/20/2007 10:46 PM

Download (3.37 KB)

View differences:

nfs_vnops.c 17 Nov 2007 09:11:28 -0000
1852 1852
		VTONFS(vp)->n_attrstamp = 0;
1853 1853
	if (!wccflag)
1854 1854
		VTONFS(tdvp)->n_attrstamp = 0;
1855
	/*
1856
	 * Kludge: Map EEXIST => 0 assuming that it is a reply to a retry.
1857
	 */
1858
	if (error == EEXIST)
1859
		error = 0;
1860 1855
	return (error);
1861 1856
}
1862 1857

  
......
1925 1920
nfsmout:
1926 1921

  
1927 1922
	/*
1928
	 * If we get an EEXIST error, silently convert it to no-error
1929
	 * in case of an NFS retry.
1930
	 */
1931
	if (error == EEXIST)
1932
		error = 0;
1933

  
1934
	/*
1935
	 * If we do not have (or no longer have) an error, and we could
1936
	 * not extract the newvp from the response due to the request being
1937
	 * NFSv2 or the error being EEXIST.  We have to do a lookup in order
1938
	 * to obtain a newvp to return.  
1923
	 * If we do not have an error, and we could not extract the newvp from
1924
	 * the response due to the request being NFSv2, we have to do a
1925
	 * lookup in order to obtain a newvp to return.  
1939 1926
	 */
1940 1927
	if (error == 0 && newvp == NULL) {
1941 1928
		struct nfsnode *np = NULL;
......
2013 2000
	VTONFS(dvp)->n_flag |= NLMODIFIED;
2014 2001
	if (!wccflag)
2015 2002
		VTONFS(dvp)->n_attrstamp = 0;
2016
	/*
2017
	 * Kludge: Map EEXIST => 0 assuming that you have a reply to a retry
2018
	 * if we can succeed in looking up the directory.
2019
	 */
2020
	if (error == EEXIST || (!error && !gotvp)) {
2021
		if (newvp) {
2022
			vrele(newvp);
2023
			newvp = (struct vnode *)0;
2024
		}
2003
	if (error == 0 && newvp == NULL) {
2025 2004
		error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
2026 2005
			cnp->cn_td, &np);
2027 2006
		if (!error) {