Bug 138350 - [ufs] [patch] UFS_EXTATTR static int prototyping error ufs_extattr_autostart_locked
Summary: [ufs] [patch] UFS_EXTATTR static int prototyping error ufs_extattr_autostart_...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-30 16:40 UTC by System V. Unix
Modified: 2009-08-31 13:00 UTC (History)
0 users

See Also:


Attachments
file.diff (647 bytes, patch)
2009-08-30 16:40 UTC, System V. Unix
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description System V. Unix 2009-08-30 16:40:02 UTC
Using additional kernel option UFS_EXTATTR in 7.2-RELEASE causes a kernel build failure 

cc -c -O2 -frename-registers -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I../../.. -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror  ../../../ufs/ufs/ufs_extattr.c
cc1: warnings being treated as errors
./../../ufs/ufs/ufs_extattr.c:97: warning: 'ufs_extattr_autostart_locked' declared 'static' but never defined
*** Error code 1


This is because the routine is getting optionally defined around line 215 with a #ifdef UFS_EXTATTR_AUTOSTART, but the prototype is missing the analoguous #ifdef, and the compiler seems to be picky.

Fix: Trivial solution. 

Simply the add the pre-process directives around the prototyping of the 
subroutine at the head of the file. The routine lower down in ufs_extattr.c already has the #ifdefs around it.

#ifdef UFS_EXTATTR_AUTOSTART
#endif /* !UFS_EXTATTR_AUTOSTART */

That way BOTH the prototype and the subroutine have that #ifdef.

e.g.
-------------
How-To-Repeat: Add option UFS_EXTATTR to the 7.2-RELEASE kernel and do a build. The problem was NOT seen in 7.1-RELEASE.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-08-30 17:44:02 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 dfilter service freebsd_committer freebsd_triage 2009-08-31 12:54:25 UTC
Author: jhb
Date: Mon Aug 31 11:54:13 2009
New Revision: 196693
URL: http://svn.freebsd.org/changeset/base/196693

Log:
  MFC a part of 191990:
  Fix compile of UFS_EXTATTR without UFS_EXTATTR_AUTOSTART.
  
  PR:		kern/138350

Modified:
  stable/7/sys/ufs/ufs/ufs_extattr.c

Modified: stable/7/sys/ufs/ufs/ufs_extattr.c
==============================================================================
--- stable/7/sys/ufs/ufs/ufs_extattr.c	Mon Aug 31 10:20:52 2009	(r196692)
+++ stable/7/sys/ufs/ufs/ufs_extattr.c	Mon Aug 31 11:54:13 2009	(r196693)
@@ -93,8 +93,10 @@ static int	ufs_extattr_set(struct vnode 
 		    struct thread *td);
 static int	ufs_extattr_rm(struct vnode *vp, int attrnamespace,
 		    const char *name, struct ucred *cred, struct thread *td);
+#ifdef UFS_EXTATTR_AUTOSTART
 static int	ufs_extattr_autostart_locked(struct mount *mp,
 		    struct thread *td);
+#endif
 static int	ufs_extattr_start_locked(struct ufsmount *ump,
 		    struct thread *td);
 
_______________________________________________
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"
Comment 3 John Baldwin freebsd_committer freebsd_triage 2009-08-31 12:54:27 UTC
State Changed
From-To: open->closed

Fix committed.  It was fixed earlier in 8.0 as a small part of another 
change.