Date: Sun, 24 Nov 2002 06:57:44 -0500 From: Hiten Pandya <hiten@angelica.unixdaemons.com> To: freebsd-hackers@FreeBSD.org Cc: bp@FreeBSD.org Subject: SMBFS uses incorrect field for process identification. Message-ID: <20021124065744.B29384@angelica.unixdaemons.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hello there.
The SMBFS build fails miserably, if SMB_VNODE_DEBUG is defined. It
fails in smbfs_vnops.c, line 255. Only in -CURRENT. This is, because
it enquires the wrong / inexistent field (struct thread)->td_pid.
I am submitting a teeny weeny delta, which changes this, to use the
correct field, which is: (struct thread)->td_proc->p_pid. You can get
justification for this, by:
# cd /sys/fs/smbfs
# cvs log -r1.13 smbfs_vnops.c
----------------------------
revision 1.13
date: 2001/12/02 08:56:58; author: bp; state: Exp; lines: +66 -65
Catch up with KSE changes.
Submitted by: Max Khon <fjoe@iclub.nsu.ru>
----------------------------
# cvs diff -u -r1.12 -r1.13 smbfs_vnops.c
%-- (extract from the diff)
- SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, p->p_pid, np->n_opencount);
+ SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, td->td_pid, np->n_opencount);
--%
Fix is attached. I have tested it with build/ and it works.
Debug extract:
"smbfs_closel: name=TheRooT, pid=927, c=1"
Cheers.
--
Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org)
http://www.unixdaemons.com/~hiten/
[-- Attachment #2 --]
Index: smbfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/smbfs/smbfs_vnops.c,v
retrieving revision 1.24
diff -u -r1.24 smbfs_vnops.c
--- smbfs_vnops.c 2002/09/26 14:07:43 1.24
+++ smbfs_vnops.c 2002/11/24 11:43:06
@@ -252,7 +252,7 @@
struct vattr vattr;
int error;
- SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, td->td_pid, np->n_opencount);
+ SMBVDEBUG("name=%s, pid=%d, c=%d\n",np->n_name, td->td_proc->p_pid, np->n_opencount);
smb_makescred(&scred, td, ap->a_cred);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021124065744.B29384>
