Re: [RFC] removing broken includes

2011-02-06 Thread Alexander Best
On Sat Feb  5 11, Giorgos Keramidas wrote:
> On Fri, 4 Feb 2011 20:19:48 +, Alexander Best  wrote:
> >On Fri Feb  4 11, John Baldwin wrote:
> >>On Thursday, February 03, 2011 5:12:57 pm Alexander Best wrote:
> >>> hi everybody,
> >>> i've started to check the source for broken includes, such as the one 
> >>> fixed in
> >>> r218189. so far i've run through arch=amd64 and found only two broken 
> >>> includes,
> >>> which should be fixed by the attached patch. the commands i'm using are:
> >>
> >> The sys/conf/files fix should definitely go in.
> >
> > as a side note: while checking the tinderbox output i saw a few gas related
> > warnings, which complained about VCS IDs being spammed to object files.
> 
> Maybe it's intentional for these objects to _have_ the VCS id in them,
> like some of the "@(#)" strings that are passed down to the ELF binary.
> 
> This sort of object data is often used to determine what bits have gone
> into the binary, so we should check if they are intentional before
> ifdef'ing them all out.
> 
> % Index: sbin/routed/rtquery/rtquery.c
> % ===
> % --- sbin/routed/rtquery/rtquery.c   (revision 218217)
> % +++ sbin/routed/rtquery/rtquery.c   (working copy)
> % @@ -49,6 +49,7 @@
> %  #include 
> %  #endif
> %
> % +#if 0
> %  #define UNUSED __attribute__((unused))
> %  #ifndef __RCSID
> %  #define __RCSID(_s) static const char rcsid[] UNUSED = _s
> % @@ -67,6 +68,7 @@
> %  __RCSID("$Revision: 2.26 $");
> %  #ident "$Revision: 2.26 $"
> %  #endif
> % +#endif
> 
> We can avoid this by building rtquery.c with -D NO__RCSID.  See below
> for the same trick about lukemftpd...
> 
> %  #ifndef sgi
> %  #define _HAVE_SIN_LEN
> % Index: contrib/lukemftp/src/main.c
> % ===
> % --- contrib/lukemftp/src/main.c (revision 218217)
> % +++ contrib/lukemftp/src/main.c (working copy)
> % @@ -96,8 +96,10 @@
> %
> %  #include 
> %  #ifndef lint
> % +#if 0
> %  __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
> % The Regents of the University of California.  All rights 
> reserved.\n");
> % +#endif
> %  #endif /* not lint */
> 
> This looks 'harmless' to include in the resulting binary, but maybe we
> should just define NO_COPYRIGHT while building lukemftp?  This will
> disable the spamming of the object code with the static string and we
> don't have to modify vendor code at all.
> 
> So, how about this instead?

i've compared the VCS info in main.c in the freebsd repository with the newest
vendor release:

FreeBSD:
---

#include 
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
The Regents of the University of California.  All rights reserved.\n");
#endif /* not lint */

#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c  8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
#endif
#endif /* not lint */

VENDOR:
--

#if 0   /* tnftp */
 
#include 
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
 The Regents of the University of California.  All rights reserved.\
  Copyright 1996-2008 The NetBSD Foundation, Inc.  All rights reserved");
#endif /* not lint */
 
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c  8.6 (Berkeley) 10/9/94";
#else
__RCSID(" NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp  ");
#endif
#endif /* not lint */
 
/*
 * FTP User Program -- Command Interface.
 */
#include 
#include 
 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#endif  /* tnftp */

... so it seems having the cvs data in object files isn't essential. however
leaving the source files for lukemftp and rtquery the way they are and adding
the -D options in order to prevent object spamming is fine for me too. :)

> 
> % diff -r bd0305f6cb2b libexec/lukemftpd/Makefile
> % --- a/libexec/lukemftpd/MakefileSat Feb 05 02:39:55 2011 +0100
> % +++ b/libexec/lukemftpd/MakefileSat Feb 05 22:28:12 2011 +0100
> % @@ -13,6 +13,7 @@ SRCS= cmds.c conf.c ftpd.c ftpcmd.y pope
> %  SRCS+= strsuftoll.c
> %
> %  WFORMAT= 0
> % +CFLAGS+= -DNO_COPYRIGHT
> %
> %  .if ${MK_INET6_SUPPORT} != "no"
> %  CFLAGS+= -DINET6
> 
> > also i noticed a lot of these warnings:
> >
> > usr/subversion-src/lib/libc/i386/string/memcpy.S:7: Warning: ignoring 
> > incorrect section type for .note.GNU-stack
> >
> > i think i've seen some recent commits dealing with that new section.
> 
> That looks like something more useful to fix now, rather than later.

...already fixed by kib in r218303 and r218305.

cheers.
alex

-- 
a13x
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: zpool v28 and -current

2011-02-06 Thread Rich
On Tue, Feb 1, 2011 at 8:12 AM, Anonymous  wrote:

>  $ fetch http://people.freebsd.org/~pjd/patches/zfs_20101212.patch.bz2
>  $ fetch -o anon_fixup.diff '
> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=55203+0+current/freebsd-current+raw
> '
>  $ bzip2 -d zfs_20101212.patch.bz2
>  $ patch -si anon_fixup.diff
>  $ cd /usr/src
>  $ patch -Efsp0 -i $OLDPWD/zfs_20101212.patch
>  [ any rejects here are probably because of $FreeBSD: ...$ vs. $FreeBSD$ ]
>  $ make -j5 world kernel DESTDIR=/
>
> Note, some bugs are fixed in pjd_zfs branch.
>
>  http://p4db.freebsd.org/changeList.cgi?FSPC=//depot/user/pjd/zfs/...
>
> My guess, pjd's patch was generated before 186914. So, in order to grab
> all latest p4 commits in the branch try
>
>  [...]
>  $ for ci in 186914 186921 186938 186940 186942 186944 186945 \
>  187192 187461 187462 187836 187837 187875 187883 188248; do
>p4diff $ci >>zfs_v28_sync.diff; done
>  $ cd /usr/src
>  $ patch -Efsp0 -i $OLDPWD/zfs_20101212.patch
>  $ patch -Efsp6 -i $OLDPWD/zfs_v28_sync.diff
>  [...]


Attempted this procedure today, make fails with:

cc -O2 -pipe -DFREEBSD_NAMECACHE -DBUILDING_ZFS -DDEBUG=1
-fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
 -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/compat/opensolaris
-I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs
-I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod
-I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common
-I/usr/local/ncvs/src/sys/modules/zfs/../..
-I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs
-I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common
-I/usr/local/ncvs/src/sys/modules/zfs/../../../include
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/local/ncvs/src/sys/DTRACE/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer
-I/usr/obj/usr/local/ncvs/src/sys/DTRACE  -mcmodel=kernel -mno-red-zone
 -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3  -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
-Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef
-Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls
-Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch
-Wno-pointer-arith -c
/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c
/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:188:
error: 'zfs_mdcomp_disable' undeclared here (not in a function)
cc1: warnings being treated as errors
/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:
In function 'arc_write':
/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3580:
warning: passing argument 7 of 'zio_write' discards qualifiers from pointer
target type

Is this a trivial fix, or something fixed in a commit I haven't pulled?

Thanks,
- Rich


>
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: zpool v28 and -current

2011-02-06 Thread Rich
On Sun, Feb 6, 2011 at 8:05 PM, Rich  wrote:

> On Tue, Feb 1, 2011 at 8:12 AM, Anonymous  wrote:
>
>>  $ fetch http://people.freebsd.org/~pjd/patches/zfs_20101212.patch.bz2
>>  $ fetch -o anon_fixup.diff '
>> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=55203+0+current/freebsd-current+raw
>> '
>>  $ bzip2 -d zfs_20101212.patch.bz2
>>  $ patch -si anon_fixup.diff
>>  $ cd /usr/src
>>  $ patch -Efsp0 -i $OLDPWD/zfs_20101212.patch
>>  [ any rejects here are probably because of $FreeBSD: ...$ vs. $FreeBSD$ ]
>>  $ make -j5 world kernel DESTDIR=/
>>
>> Note, some bugs are fixed in pjd_zfs branch.
>>
>>  http://p4db.freebsd.org/changeList.cgi?FSPC=//depot/user/pjd/zfs/...
>>
>> My guess, pjd's patch was generated before 186914. So, in order to grab
>> all latest p4 commits in the branch try
>>
>>  [...]
>>  $ for ci in 186914 186921 186938 186940 186942 186944 186945 \
>>  187192 187461 187462 187836 187837 187875 187883 188248; do
>>p4diff $ci >>zfs_v28_sync.diff; done
>>  $ cd /usr/src
>>  $ patch -Efsp0 -i $OLDPWD/zfs_20101212.patch
>>  $ patch -Efsp6 -i $OLDPWD/zfs_v28_sync.diff
>>  [...]
>
>
> Attempted this procedure today, make fails with:
>
> cc -O2 -pipe -DFREEBSD_NAMECACHE -DBUILDING_ZFS -DDEBUG=1
> -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
>  -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/compat/opensolaris
> -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs
> -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod
> -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common
> -I/usr/local/ncvs/src/sys/modules/zfs/../..
> -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs
> -I/usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common
> -I/usr/local/ncvs/src/sys/modules/zfs/../../../include
> -DHAVE_KERNEL_OPTION_HEADERS -include
> /usr/obj/usr/local/ncvs/src/sys/DTRACE/opt_global.h -I. -I@ -I@/contrib/altq
> -finline-limit=8000 --param inline-unit-growth=100 --param
> large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer
> -I/usr/obj/usr/local/ncvs/src/sys/DTRACE  -mcmodel=kernel -mno-red-zone
>  -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3  -msoft-float
> -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
> -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs
> -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
> -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions
> -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef
> -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls
> -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch
> -Wno-pointer-arith -c
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:188:
> error: 'zfs_mdcomp_disable' undeclared here (not in a function)
> cc1: warnings being treated as errors
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:
> In function 'arc_write':
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3580:
> warning: passing argument 7 of 'zio_write' discards qualifiers from pointer
> target type
>

First error is just a variable undefined that was defined in the original
file pre-patching in the function; redefined it as defined in the original.

Second error is because arc_write takes a const of that property now, and
zio_write still doesn't, resulting in the warning as shown. Dunno what the
correct way to fix this is, as it's unclear to me why the change was done.

This looks more broken than I might hope to fix trivially, since working
around the second one above results in more brokenness in dbuf.c. I suppose
I'll wait for an updated patchset to try this out again.

- Rich
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: zpool v28 and -current

2011-02-06 Thread Anonymous
Rich  writes:

>> Attempted this procedure today, make fails with:
[...]
>> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:188:
>> error: 'zfs_mdcomp_disable' undeclared here (not in a function)
>
> First error is just a variable undefined that was defined in the original
> file pre-patching in the function; redefined it as defined in the original.

No, it should be removed from there. See if you have arc.c.rej.

%%
@@ -186,14 +185,11 @@
 TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
 TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
 TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
-TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,
 "Maximum ARC size");
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RDTUN, &zfs_arc_min, 0,
 "Minimum ARC size");
-SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RDTUN,
-&zfs_mdcomp_disable, 0, "Disable metadata compression");
 
 /*
  * Note that buffers can be in one of 6 states:
%%

>> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3580:
>> warning: passing argument 7 of 'zio_write' discards qualifiers from pointer 
>> target type
>
> Second error is because arc_write takes a const of that property now, and
> zio_write still doesn't, resulting in the warning as shown. Dunno what the
> correct way to fix this is, as it's unclear to me why the change was done.

Did you count wrong? The 7th argument to zio_write() around 3580 line is
`&zp' vs. `zp'.

%%
@@ -3563,8 +3573,7 @@
callback->awcb_private = private;
callback->awcb_buf = buf;
 
-   write_policy(spa, wp, &zp);
-   zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, &zp,
+   zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, zp,
arc_write_ready, arc_write_done, callback, priority, zio_flags, zb);
 
return (zio);
%%

> This looks more broken than I might hope to fix trivially, since working
> around the second one above results in more brokenness in dbuf.c. I suppose
> I'll wait for an updated patchset to try this out again.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: zpool v28 and -current

2011-02-06 Thread Rich
On Sun, Feb 6, 2011 at 9:53 PM, Anonymous  wrote:

> Rich  writes:
>
> >> Attempted this procedure today, make fails with:
> [...]
> >>
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:188:
> >> error: 'zfs_mdcomp_disable' undeclared here (not in a function)
> >
> > First error is just a variable undefined that was defined in the original
> > file pre-patching in the function; redefined it as defined in the
> original.
>
> No, it should be removed from there. See if you have arc.c.rej.
>

I do; as soon as I get to the machine in question, I'll quote it for you.


> %%
> @@ -186,14 +185,11 @@
>  TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
>  TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
>  TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
> -TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable);
>  SYSCTL_DECL(_vfs_zfs);
>  SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,
> "Maximum ARC size");
>  SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RDTUN, &zfs_arc_min, 0,
> "Minimum ARC size");
> -SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RDTUN,
> -&zfs_mdcomp_disable, 0, "Disable metadata compression");
>
>  /*
>  * Note that buffers can be in one of 6 states:
> %%
>
> >>
> /usr/local/ncvs/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c:3580:
> >> warning: passing argument 7 of 'zio_write' discards qualifiers from
> pointer target type
> >
> > Second error is because arc_write takes a const of that property now, and
> > zio_write still doesn't, resulting in the warning as shown. Dunno what
> the
> > correct way to fix this is, as it's unclear to me why the change was
> done.
>
> Did you count wrong? The 7th argument to zio_write() around 3580 line is
> `&zp' vs. `zp'.
>

In my copy of said file, zp is defined in the signature of arc_write as
const, which is where the error comes from.

- Rich
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"