NetBSD Problem Report #39494
From www@NetBSD.org Sat Sep 6 17:51:32 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id E702763B853
for <gnats-bugs@gnats.netbsd.org>; Sat, 6 Sep 2008 17:51:31 +0000 (UTC)
Message-Id: <20080906175131.74B2963B11D@narn.NetBSD.org>
Date: Sat, 6 Sep 2008 17:51:31 +0000 (UTC)
From: xtraeme@gmail.com
Reply-To: xtraeme@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Common global symbol defined twice: smbfs_node_pool
X-Send-Pr-Version: www-1.0
>Number: 39494
>Category: kern
>Synopsis: Common global symbol defined twice: smbfs_node_pool
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: tron
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 06 17:55:00 +0000 2008
>Closed-Date: Sun Sep 07 13:21:03 +0000 2008
>Last-Modified: Sun Sep 07 13:21:03 +0000 2008
>Originator: Juan RP
>Release: Latest
>Organization:
>Environment:
NetBSD vmware-netbsd 4.99.72 NetBSD 4.99.72 (MASTER) #13: Sat Sep 6 19:20:40 CEST 2008 juan@vmware-netbsd:/home/juan/build/obj/sys/arch/i386/compile/MASTER i386
>Description:
When linking the kernel with --warn-common, a warning of a common global symbol of the same size was found for 'smbfs_node_pool'.
smbfs_node_pool is declared as global in sys/fs/smbfs_vfsops.c.
smbfs_node_pool is declared as global in sys/fs/smbfs_node.c.
Therefore only a definition is needed... I declared it as extern in smbfs.h and declare it in only one place.
>How-To-Repeat:
Code inspection.
>Fix:
Index: smbfs.h
===================================================================
RCS file: /cvsroot/src/sys/fs/smbfs/smbfs.h,v
retrieving revision 1.16
diff -b -u -p -r1.16 smbfs.h
--- smbfs.h 26 Jan 2008 14:25:38 -0000 1.16
+++ smbfs.h 6 Sep 2008 17:03:57 -0000
@@ -70,6 +70,7 @@ struct smb_share;
struct u_cred;
struct vop_ioctl_args;
struct buf;
+struct pool;
struct smbmount {
struct smbfs_args sm_args;
@@ -95,6 +96,9 @@ struct smbmount {
int smbfs_doio(struct buf *, kauth_cred_t, struct lwp *);
int smbfs_vinvalbuf(struct vnode *, int, kauth_cred_t, struct lwp *, int);
int smbfs_kqfilter(void *);
+
+extern struct pool smbfs_node_pool;
+
#endif /* KERNEL */
#endif /* _FS_SMBFS_SMBFS_H_ */
Index: smbfs_node.c
===================================================================
RCS file: /cvsroot/src/sys/fs/smbfs/smbfs_node.c,v
retrieving revision 1.39
diff -b -u -p -r1.39 smbfs_node.c
--- smbfs_node.c 24 Jun 2008 17:04:11 -0000 1.39
+++ smbfs_node.c 6 Sep 2008 17:03:57 -0000
@@ -73,8 +73,6 @@ static const struct genfs_ops smbfs_genf
.gop_write = genfs_compat_gop_write,
};
-struct pool smbfs_node_pool;
-
static inline char *
smbfs_name_alloc(const u_char *name, int nmlen)
{
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->tron
Responsible-Changed-By: tron@NetBSD.org
Responsible-Changed-When: Sun, 07 Sep 2008 12:33:26 +0000
Responsible-Changed-Why:
I'll handle this PR.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/39494 CVS commit: src/sys/fs/smbfs
Date: Sun, 7 Sep 2008 13:13:04 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Sun Sep 7 13:13:04 UTC 2008
Modified Files:
src/sys/fs/smbfs: smbfs.h smbfs_vfsops.c
Log Message:
Remove duplicate definition of "smbfs_node_pool".
Fix based on a patch provided by Juan RP in PR kern/39494.
To generate a diff of this commit:
cvs rdiff -r1.16 -r1.17 src/sys/fs/smbfs/smbfs.h
cvs rdiff -r1.84 -r1.85 src/sys/fs/smbfs/smbfs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: tron@NetBSD.org
State-Changed-When: Sun, 07 Sep 2008 13:21:03 +0000
State-Changed-Why:
I've committed a modified version of your patch. I removed the
definition of "smbfs_node_pool" from "smbfs_vfsops.c" because
the node pool is actually used by "smbfs_node". This is also
more consistent with your fix for PR kern/39493.
Thanks a lot for the bug report and the patch.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.