Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2012 04:29:47 +0000 (UTC)
From:      Davide Italiano <davide@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243548 - head/sys/fs/smbfs
Message-ID:  <201211260429.qAQ4Tlqw093986@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davide
Date: Mon Nov 26 04:29:47 2012
New Revision: 243548
URL: http://svnweb.freebsd.org/changeset/base/243548

Log:
  - smbfs_rename() might return an error value without correctly upgrading
  the vnode use count, and this might cause the kernel to panic if compiled
  with WITNESS enable.
  - Be sure to put the '\0' terminator to the rpath string.
  
  Sponsored by:	iXsystems inc.

Modified:
  head/sys/fs/smbfs/smbfs_node.c
  head/sys/fs/smbfs/smbfs_vnops.c

Modified: head/sys/fs/smbfs/smbfs_node.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_node.c	Mon Nov 26 04:26:27 2012	(r243547)
+++ head/sys/fs/smbfs/smbfs_node.c	Mon Nov 26 04:29:47 2012	(r243548)
@@ -187,6 +187,7 @@ smbfs_node_alloc(struct mount *mp, struc
 		bcopy(name, p, nmlen);
 		p += nmlen;
 	}
+	*p = '\0';
 	MPASS(p == rpath + rplen);
 	lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
 	/* Vnode initialization */

Modified: head/sys/fs/smbfs/smbfs_vnops.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_vnops.c	Mon Nov 26 04:26:27 2012	(r243547)
+++ head/sys/fs/smbfs/smbfs_vnops.c	Mon Nov 26 04:29:47 2012	(r243548)
@@ -583,12 +583,12 @@ smbfs_rename(ap)
 	/* Check for cross-device rename */
 	if ((fvp->v_mount != tdvp->v_mount) ||
 	    (tvp && (fvp->v_mount != tvp->v_mount))) {
-		return EXDEV;
+		error = EXDEV;
 		goto out;
 	}
 
 	if (tvp && vrefcnt(tvp) > 1) {
-		return EBUSY;
+		error = EBUSY;
 		goto out;
 	}
 	flags = 0x10;			/* verify all writes */



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