Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2011 16:20:03 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-fs@FreeBSD.org
Subject:   Re: kern/159418: commit references a PR
Message-ID:  <201111221620.pAMGK3jG013795@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/159418; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/159418: commit references a PR
Date: Tue, 22 Nov 2011 16:18:26 +0000 (UTC)

 Author: ivoras
 Date: Tue Nov 22 16:18:12 2011
 New Revision: 227822
 URL: http://svn.freebsd.org/changeset/base/227822
 
 Log:
   Avoid panics from recursive rename operations. Not a perfect patch but
   good enough for now.
   
   PR:		kern/159418
   Submitted by:	Gleb Kurtsou
   Reviewed by:	kib
   MFC after:	1 month
 
 Modified:
   head/sys/fs/tmpfs/tmpfs_vnops.c
 
 Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
 ==============================================================================
 --- head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Nov 22 16:08:12 2011	(r227821)
 +++ head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Nov 22 16:18:12 2011	(r227822)
 @@ -965,11 +965,8 @@ tmpfs_rename(struct vop_rename_args *v)
  
  	/* If we need to move the directory between entries, lock the
  	 * source so that we can safely operate on it. */
 -	if (tdvp != fdvp) {
 -		error = vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
 -		if (error != 0)
 -			goto out;
 -	}
 +	if (fdvp != tdvp && fdvp != tvp)
 +		vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
  	fdnode = VP_TO_TMPFS_DIR(fdvp);
  	fnode = VP_TO_TMPFS_NODE(fvp);
  	de = tmpfs_dir_lookup(fdnode, fnode, fcnp);
 @@ -1143,7 +1140,7 @@ tmpfs_rename(struct vop_rename_args *v)
  	error = 0;
  
  out_locked:
 -	if (fdnode != tdnode)
 +	if (fdvp != tdvp && fdvp != tvp)
  		VOP_UNLOCK(fdvp, 0);
  
  out:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



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