Re: svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale
On Tue, Aug 11, 2015 at 09:59:36PM +, Jilles Tjoelker wrote: Author: jilles Date: Tue Aug 11 21:59:36 2015 New Revision: 286649 URL: https://svnweb.freebsd.org/changeset/base/286649 Log: Fix and re-enable UTF-8 tests. Thank you very much I should have fixed it myself earlier. Sorry. Bapt pgp0wwxai8P0P.pgp Description: PGP signature
Re: svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale
On Tue, Aug 11, 2015 at 2:59 PM, Jilles Tjoelker jil...@freebsd.org wrote: Author: jilles Date: Tue Aug 11 21:59:36 2015 New Revision: 286649 URL: https://svnweb.freebsd.org/changeset/base/286649 Log: Fix and re-enable UTF-8 tests. Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c head/lib/libc/tests/locale/Makefile I would have appreciated a CR :(... ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286650 - head/etc
Author: delphij Date: Tue Aug 11 22:43:28 2015 New Revision: 286650 URL: https://svnweb.freebsd.org/changeset/base/286650 Log: Disable building INDEX-9 and INDEX-10 because they are not useful for users who uses only FreeBSD -CURRENT, and building these indexes are only useful to those who share ports tree across different FreeBSD releases, and system administrator with that need can always enable this behavior. MFC after:2 weeks (only the principals, not actual change) Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf == --- head/etc/portsnap.conf Tue Aug 11 21:59:36 2015(r286649) +++ head/etc/portsnap.conf Tue Aug 11 22:43:28 2015(r286650) @@ -30,6 +30,6 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-9 DESCRIBE.9 -INDEX INDEX-10 DESCRIBE.10 +#INDEX INDEX-9 DESCRIBE.9 +#INDEX INDEX-10 DESCRIBE.10 INDEX INDEX-11 DESCRIBE.11 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286618 - in head/sys: kern sys
Author: ed Date: Tue Aug 11 08:43:50 2015 New Revision: 286618 URL: https://svnweb.freebsd.org/changeset/base/286618 Log: Introduce kern_cap_rights_limit(). The existing sys_cap_rights_limit() expects that a cap_rights_t object lives in userspace. It is therefore hard to call into it from kernelspace. Move the interesting bits of sys_cap_rights_limit() into kern_cap_rights_limit(), so that we can call into it from the CloudABI compatibility layer. Obtained from:https://github.com/NuxiNL/freebsd Differential Revision:https://reviews.freebsd.org/D3314 Modified: head/sys/kern/sys_capability.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/sys_capability.c == --- head/sys/kern/sys_capability.c Tue Aug 11 05:58:33 2015 (r286617) +++ head/sys/kern/sys_capability.c Tue Aug 11 08:43:50 2015 (r286618) @@ -213,15 +213,41 @@ cap_rights(struct filedesc *fdp, int fd) return (cap_rights_fde(fdp-fd_ofiles[fd])); } +int +kern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights) +{ + struct filedesc *fdp; + int error; + + fdp = td-td_proc-p_fd; + FILEDESC_XLOCK(fdp); + if (fget_locked(fdp, fd) == NULL) { + FILEDESC_XUNLOCK(fdp); + return (EBADF); + } + error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE); + if (error == 0) { + fdp-fd_ofiles[fd].fde_rights = *rights; + if (!cap_rights_is_set(rights, CAP_IOCTL)) { + free(fdp-fd_ofiles[fd].fde_ioctls, M_FILECAPS); + fdp-fd_ofiles[fd].fde_ioctls = NULL; + fdp-fd_ofiles[fd].fde_nioctls = 0; + } + if (!cap_rights_is_set(rights, CAP_FCNTL)) + fdp-fd_ofiles[fd].fde_fcntls = 0; + } + FILEDESC_XUNLOCK(fdp); + return (error); +} + /* * System call to limit rights of the given capability. */ int sys_cap_rights_limit(struct thread *td, struct cap_rights_limit_args *uap) { - struct filedesc *fdp; cap_rights_t rights; - int error, fd, version; + int error, version; cap_rights_init(rights); @@ -252,30 +278,9 @@ sys_cap_rights_limit(struct thread *td, ktrcaprights(rights); #endif - fd = uap-fd; - - AUDIT_ARG_FD(fd); + AUDIT_ARG_FD(uap-fd); AUDIT_ARG_RIGHTS(rights); - - fdp = td-td_proc-p_fd; - FILEDESC_XLOCK(fdp); - if (fget_locked(fdp, fd) == NULL) { - FILEDESC_XUNLOCK(fdp); - return (EBADF); - } - error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE); - if (error == 0) { - fdp-fd_ofiles[fd].fde_rights = rights; - if (!cap_rights_is_set(rights, CAP_IOCTL)) { - free(fdp-fd_ofiles[fd].fde_ioctls, M_FILECAPS); - fdp-fd_ofiles[fd].fde_ioctls = NULL; - fdp-fd_ofiles[fd].fde_nioctls = 0; - } - if (!cap_rights_is_set(rights, CAP_FCNTL)) - fdp-fd_ofiles[fd].fde_fcntls = 0; - } - FILEDESC_XUNLOCK(fdp); - return (error); + return (kern_cap_rights_limit(td, uap-fd, rights)); } /* Modified: head/sys/sys/syscallsubr.h == --- head/sys/sys/syscallsubr.h Tue Aug 11 05:58:33 2015(r286617) +++ head/sys/sys/syscallsubr.h Tue Aug 11 08:43:50 2015(r286618) @@ -74,6 +74,7 @@ int kern_alternate_path(struct thread *t intkern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); intkern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds, size_t ncmds); +intkern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights); intkern_chdir(struct thread *td, char *path, enum uio_seg pathseg); intkern_clock_getcpuclockid2(struct thread *td, id_t id, int which, clockid_t *clk_id); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286619 - head/sys/compat/cloudabi
Author: ed Date: Tue Aug 11 08:44:19 2015 New Revision: 286619 URL: https://svnweb.freebsd.org/changeset/base/286619 Log: Make cap_rights_limit() work for CloudABI processes. Call into the recently introduced kern_cap_rights_limit() function to restrict rights. Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c == --- head/sys/compat/cloudabi/cloudabi_fd.c Tue Aug 11 08:43:50 2015 (r286618) +++ head/sys/compat/cloudabi/cloudabi_fd.c Tue Aug 11 08:44:19 2015 (r286619) @@ -523,6 +523,7 @@ cloudabi_sys_fd_stat_put(struct thread * struct cloudabi_sys_fd_stat_put_args *uap) { cloudabi_fdstat_t fsb; + cap_rights_t rights; int error, oflags; error = copyin(uap-buf, fsb, sizeof(fsb)); @@ -540,6 +541,13 @@ cloudabi_sys_fd_stat_put(struct thread * CLOUDABI_FDFLAG_DSYNC | CLOUDABI_FDFLAG_RSYNC)) oflags |= O_SYNC; return (kern_fcntl(td, uap-fd, F_SETFL, oflags)); + } else if (uap-flags == CLOUDABI_FDSTAT_RIGHTS) { + /* Convert rights. */ + error = cloudabi_convert_rights( + fsb.fs_rights_base | fsb.fs_rights_inheriting, rights); + if (error != 0) + return (error); + return (kern_cap_rights_limit(td, uap-fd, rights)); } return (EINVAL); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286621 - head/usr.sbin/bhyve
Author: mav Date: Tue Aug 11 08:58:00 2015 New Revision: 286621 URL: https://svnweb.freebsd.org/changeset/base/286621 Log: Fix minor typo. MFC after:3 days Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 == --- head/usr.sbin/bhyve/bhyve.8 Tue Aug 11 08:57:04 2015(r286620) +++ head/usr.sbin/bhyve/bhyve.8 Tue Aug 11 08:58:00 2015(r286621) @@ -331,7 +331,7 @@ bhyve -c 4 \e\ -s 1:5,ahci-hd,/images/disk.6 \\ -s 1:6,ahci-hd,/images/disk.7 \\ -s 1:7,ahci-hd,/images/disk.8 \\ - -s 2,ahci-cd,/images.install.iso \\ + -s 2,ahci-cd,/images/install.iso \\ -s 3,virtio-net,tap0 \\ -l com1,/dev/nmdm0A \\ -A -H -P -m 8G ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286620 - head/contrib/netbsd-tests/lib/libc/regex
Author: bapt Date: Tue Aug 11 08:57:04 2015 New Revision: 286620 URL: https://svnweb.freebsd.org/changeset/base/286620 Log: Disable broken test until we have time ti actually fix the test Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c == --- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:44:19 2015(r286619) +++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:57:04 2015(r286620) @@ -631,7 +631,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, categorization); ATF_TP_ADD_TC(tp, nullsubexpr); - ATF_TP_ADD_TC(tp, leftassoc); +// ATF_TP_ADD_TC(tp, leftassoc); ATF_TP_ADD_TC(tp, rightassoc); ATF_TP_ADD_TC(tp, forcedassoc); ATF_TP_ADD_TC(tp, repetition); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286601 - head/usr.bin/patch
On Mon, 10 Aug 2015, Xin Li wrote: On 8/10/15 22:51, Ed Schouten wrote: 2015-08-11 1:20 GMT+02:00 Xin Li delp...@delphij.net: Do you have a better solution for this? No, this is not ideal but I didn't find a better alternative (or maybe I have missed something obvious?) I think with the current POSIX definition of the interface, we have only two options: either strdup() or cast away const (I'd rather hide this kind of uglyness in the library), no? Casting const away should be all right in this case. It is the Standard way. Committed as r286617, please let me know if you want other changes, etc. Perhaps we should convert the tree over time to use __DECONST instead then? Gak!. I use rmrf on code with __DECONST in it. The misimplementation of __DECONST only works because -Wcast-qual is too broken to detect removal of qualifiers by casting a pointer to an integer. Casting a pointer to an integer is much less safe than casting away only a qualifer for a pointer, but both are Standard, so they work unless the compiler is directed to be nonstandard using -Wcast-qual -Werror. Compilers should know about the language defects that make it impossible to declare functions like execv() with the correct number of const's and turn off -Wcast-qual warnings for these functions. strchr() is another function that needs special. It can take a pointer const char and return a related pointer with the const qualifier removed (subtract an offset to get the original pointer with its const qualifier removed). The warning about this from -Wcast-qual is not yet killed using __DECONST() because libc is still compiled with a low WARNS. The implementation uses a cast in the Standard way. Only the implementation would be affected by -Wcast-qual. But a flag like -Wcast-qual should direct the compiler to warn about removal of casts by abusing strchr() too. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286601 - head/usr.bin/patch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 8/10/15 22:51, Ed Schouten wrote: 2015-08-11 1:20 GMT+02:00 Xin Li delp...@delphij.net: Do you have a better solution for this? No, this is not ideal but I didn't find a better alternative (or maybe I have missed something obvious?) I think with the current POSIX definition of the interface, we have only two options: either strdup() or cast away const (I'd rather hide this kind of uglyness in the library), no? Casting const away should be all right in this case. Committed as r286617, please let me know if you want other changes, etc. Perhaps we should convert the tree over time to use __DECONST instead then? Cheers, -BEGIN PGP SIGNATURE- iQIbBAEBCgAGBQJVyY+KAAoJEJW2GBstM+nsI4MP+LG3zqlTe2UvL+AL03K2LECM 3qXdiDjkFEhlmyTJ4lQIO2BgqOfQSvxkxaeCs8mMYuOSyPFVmk9tYgS57QKkcoPq rqDCD+w8P0njzvC+PhD5FNBaY0PEq3uapyoqAMvbSMWKS6n4d1Mw5nHrWm3frkS4 filVI5ZBiP+FvxEYZIraqi/D9GFwsGDiaJoQFkn8KN/SjCq4nu01MMWXs9uwYFn7 dsf6xBiXw2XS5ugCQoJvE73EqtUQKNYXFLpqWFDfOroKPN+vILaZRgYeXERJazNh Sx8FWU97BioZhujn9XCS+68MLezS+5tN/ky6PAkcDpih3oW5z5q8E0wKHPR6UTKl 651d1NMfiP9bHYLErA2K8zl5iZ3LsIUikxeJE5nh33Mw02tgjlKkXbXq9AMen9Au Pcl7q09FYXf9RYmBbWrMfGaZdAlWpbP1DMKsVrKabXIXiKbieY+GF8knxJuuEdtS ZqxGlgXeMCWgRDix84ZYYqDSrJsEc0/0EyrlabLuTtf84Ax2xmtUGxt24O0y2S5u 8gJyji39ed0PneRAlPztFz0jiK++KmyLJOAI+cU3oNWoE+tIT+NwKWe7btZuR6A6 Oo0kGrTLX3VQkGOzRYiNd8NYOAGRzGppvuGsEEesAJF1NxX/Yu1rW9Cr7GQ9juWj 7/2k0+Nzy4p7i58Gkn4= =LyPN -END PGP SIGNATURE- ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286570 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Alexander, On Mon, 10 Aug 2015, Alexander Motin wrote: Author: mav Date: Mon Aug 10 10:34:23 2015 New Revision: 286570 URL: https://svnweb.freebsd.org/changeset/base/286570 Log: MFV r277426: 5408 managing ZFS cache devices requires lots of RAM illumos/illumos-gate@89c86e32293a30cdd7af530c38b2073fee01411c [snip] For an average blocksize of 8KB, this means that for the L2ARC, the ratio of metadata to data has gone down from about 2.92% to 1.56%. For a 'storage optimized' EC2 instance with 1600GB of SSD and 60GB of RAM, this means that we expect a completely full L2ARC to use (1600 GB * 0.0156) / 60GB = 41% of the available memory, down from 78%. Thanks! Any MFC planned please? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: ma...@freebsd.org ] *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru *** ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286458 - in head/sys: net netinet netinet6
10.08.2015, 15:20, Alexander V. Chernikov melif...@freebsd.org: 10.08.2015, 10:55, Julian Elischer jul...@freebsd.org: On 8/9/15 2:15 AM, Alexander V. Chernikov wrote: Author: melifaro Date: Sat Aug 8 18:14:59 2015 New Revision: 286458 URL: https://svnweb.freebsd.org/changeset/base/286458 Log: MFP r274295: * Move interface route cleanup to route.c:rt_flushifroutes() * Convert most of for (fibnum = 0; fibnum rt_numfibs; fibnum++) users to use new rt_foreach_fib() instead of hand-rolling cycles. I think rt_foreach_fib() is poorly named. My expectation is that it would call a function for each fib, or be a macro that just iterates fibs, rather than actually walking the tree. Yes, you're right. Thanks for the hint, I'll rename it to rt_foreach_fib_walk(). Committed as r286594. rt_foreach_fib_walk() maybe. Mod ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286617 - head/usr.bin/patch
2015-08-11 7:58 GMT+02:00 Xin LI delp...@freebsd.org: Log: Use __DECONST instead of doing strdup/free. Thanks! :-) -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286624 - in head/sys: net netinet netinet6
Author: melifaro Date: Tue Aug 11 09:26:11 2015 New Revision: 286624 URL: https://svnweb.freebsd.org/changeset/base/286624 Log: Store addresses instead of sockaddrs inside llentry. This permits us having all (not fully true yet) all the info needed in lookup process in first 64 bytes of 'struct llentry'. struct llentry layout: BEFORE: [rwlock .. state .. state .. MAC ] (lle+1) [sockaddr_in[6]] AFTER [ in[6]_addr MAC .. state .. rwlock ] Currently, address part of struct llentry has only 16 bytes for the key. However, lltable does not restrict any custom lltable consumers with long keys use the previous approach (store key at (lle+1)). Sponsored by: Yandex LLC Modified: head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet/toecore.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/if_llatbl.h == --- head/sys/net/if_llatbl.hTue Aug 11 09:18:51 2015(r286623) +++ head/sys/net/if_llatbl.hTue Aug 11 09:26:11 2015(r286624) @@ -54,7 +54,18 @@ extern struct rwlock lltable_rwlock; */ struct llentry { LIST_ENTRY(llentry) lle_next; - struct rwlocklle_lock; + union { + struct in_addr addr4; + struct in6_addr addr6; + } r_l3addr; + union { + uint64_tmac_aligned; + uint16_tmac16[3]; + uint8_t mac8[20]; /* IB needs 20 bytes. */ + } ll_addr; + uint32_tspare0; + uint64_tspare1; + struct lltable *lle_tbl; struct llentries *lle_head; void(*lle_free)(struct llentry *); @@ -70,19 +81,13 @@ struct llentry { time_t ln_ntick; int lle_refcnt; - union { - uint64_tmac_aligned; - uint16_tmac16[3]; - uint8_t mac8[20]; /* IB needs 20 bytes. */ - } ll_addr; - LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */ /* XXX af-private? */ union { struct callout ln_timer_ch; struct callout la_timer; } lle_timer; - /* NB: struct sockaddr must immediately follow */ + struct rwlocklle_lock; }; #defineLLE_WLOCK(lle) rw_wlock((lle)-lle_lock) @@ -133,11 +138,6 @@ struct llentry { #defineln_timer_ch lle_timer.ln_timer_ch #definela_timerlle_timer.la_timer -/* XXX bad name */ -#defineL3_CADDR(lle) ((const struct sockaddr *)(lle[1])) -#defineL3_ADDR(lle)((struct sockaddr *)(lle[1])) -#defineL3_ADDR_LEN(lle)(((struct sockaddr *)(lle[1]))-sa_len) - typedefstruct llentry *(llt_lookup_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); typedefstruct llentry *(llt_create_t)(struct lltable *, u_int flags, Modified: head/sys/netinet/if_ether.c == --- head/sys/netinet/if_ether.c Tue Aug 11 09:18:51 2015(r286623) +++ head/sys/netinet/if_ether.c Tue Aug 11 09:26:11 2015(r286624) @@ -813,7 +813,7 @@ match: m_hold = la-la_hold; la-la_hold = NULL; la-la_numheld = 0; - memcpy(sa, L3_ADDR(la), sizeof(sa)); + lltable_fill_sa_entry(la, (struct sockaddr *)sa); LLE_WUNLOCK(la); for (; m_hold != NULL; m_hold = m_hold_next) { m_hold_next = m_hold-m_nextpkt; Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Tue Aug 11 09:18:51 2015(r286623) +++ head/sys/netinet/in.c Tue Aug 11 09:26:11 2015(r286624) @@ -958,7 +958,6 @@ in_purgemaddrs(struct ifnet *ifp) struct in_llentry { struct llentry base; - struct sockaddr_in l3_addr4; }; #defineIN_LLTBL_DEFAULT_HSIZE 32 @@ -980,7 +979,7 @@ in_lltable_destroy_lle(struct llentry *l } static struct llentry * -in_lltable_new(const struct sockaddr *l3addr, u_int flags) +in_lltable_new(struct in_addr addr4, u_int flags) { struct in_llentry *lle; @@ -993,7 +992,7 @@ in_lltable_new(const struct sockaddr *l3 * an ARP request. */ lle-base.la_expire = time_uptime; /* mark expired */ - lle-l3_addr4 = *(const struct sockaddr_in *)l3addr; + lle-base.r_l3addr.addr4 = addr4; lle-base.lle_refcnt = 1; lle-base.lle_free = in_lltable_destroy_lle; LLE_LOCK_INIT(lle-base); @@
Re: svn commit: r286570 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
On 11.08.2015 12:38, Dmitry Morozovsky wrote: Alexander, On Mon, 10 Aug 2015, Alexander Motin wrote: Author: mav Date: Mon Aug 10 10:34:23 2015 New Revision: 286570 URL: https://svnweb.freebsd.org/changeset/base/286570 Log: MFV r277426: 5408 managing ZFS cache devices requires lots of RAM illumos/illumos-gate@89c86e32293a30cdd7af530c38b2073fee01411c [snip] For an average blocksize of 8KB, this means that for the L2ARC, the ratio of metadata to data has gone down from about 2.92% to 1.56%. For a 'storage optimized' EC2 instance with 1600GB of SSD and 60GB of RAM, this means that we expect a completely full L2ARC to use (1600 GB * 0.0156) / 60GB = 41% of the available memory, down from 78%. Thanks! Any MFC planned please? Theoretically planned, but no specific terms yet -- too many changes. -- Alexander Motin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286622 - head/usr.sbin/bhyve
Author: mav Date: Tue Aug 11 09:00:27 2015 New Revision: 286622 URL: https://svnweb.freebsd.org/changeset/base/286622 Log: Another small typo. MFC after:3 days Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 == --- head/usr.sbin/bhyve/bhyve.8 Tue Aug 11 08:58:00 2015(r286621) +++ head/usr.sbin/bhyve/bhyve.8 Tue Aug 11 09:00:27 2015(r286622) @@ -321,7 +321,7 @@ port connected to an .Xr nmdm 4 null-modem device. .Bd -literal -offset indent -bhyve -c 4 \e\ +bhyve -c 4 \\ -s 0,amd_hostbridge -s 1,lpc \\ -s 1:0,ahci-hd,/images/disk.1 \\ -s 1:1,ahci-hd,/images/disk.2 \\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286629 - in head/sys: net netinet netinet6
Author: melifaro Date: Tue Aug 11 12:38:54 2015 New Revision: 286629 URL: https://svnweb.freebsd.org/changeset/base/286629 Log: Use single 'lle_timer' callout in lltable instead of two different names of the same timer. Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_llatbl.c == --- head/sys/net/if_llatbl.cTue Aug 11 12:38:01 2015(r286628) +++ head/sys/net/if_llatbl.cTue Aug 11 12:38:54 2015(r286629) @@ -374,7 +374,7 @@ lltable_free(struct lltable *llt) IF_AFDATA_WUNLOCK(llt-llt_ifp); LIST_FOREACH_SAFE(lle, dchain, lle_chain, next) { - if (callout_stop(lle-la_timer)) + if (callout_stop(lle-lle_timer)) LLE_REMREF(lle); llentry_free(lle); } @@ -656,7 +656,7 @@ llatbl_lle_show(struct llentry_sa *la) bcopy(lle-ll_addr.mac16, octet, sizeof(octet)); db_printf( ll_addr=%02x:%02x:%02x:%02x:%02x:%02x\n, octet[0], octet[1], octet[2], octet[3], octet[4], octet[5]); - db_printf( la_timer=%p\n, lle-la_timer); + db_printf( lle_timer=%p\n, lle-lle_timer); switch (la-l3_addr.sa_family) { #ifdef INET Modified: head/sys/net/if_llatbl.h == --- head/sys/net/if_llatbl.hTue Aug 11 12:38:01 2015(r286628) +++ head/sys/net/if_llatbl.hTue Aug 11 12:38:54 2015(r286629) @@ -82,11 +82,7 @@ struct llentry { int lle_refcnt; LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */ - /* XXX af-private? */ - union { - struct callout ln_timer_ch; - struct callout la_timer; - } lle_timer; + struct callout lle_timer; struct rwlocklle_lock; }; @@ -135,9 +131,6 @@ struct llentry { } while (0) -#defineln_timer_ch lle_timer.ln_timer_ch -#definela_timerlle_timer.la_timer - typedefstruct llentry *(llt_lookup_t)(struct lltable *, u_int flags, const struct sockaddr *l3addr); typedefstruct llentry *(llt_create_t)(struct lltable *, u_int flags, Modified: head/sys/netinet/if_ether.c == --- head/sys/netinet/if_ether.c Tue Aug 11 12:38:01 2015(r286628) +++ head/sys/netinet/if_ether.c Tue Aug 11 12:38:54 2015(r286629) @@ -170,7 +170,7 @@ arptimer(void *arg) return; } LLE_WLOCK(lle); - if (callout_pending(lle-la_timer)) { + if (callout_pending(lle-lle_timer)) { /* * Here we are a bit odd here in the treatment of * active/pending. If the pending bit is set, it got @@ -202,7 +202,7 @@ arptimer(void *arg) EVENTHANDLER_INVOKE(lle_event, lle, evt); } - callout_stop(lle-la_timer); + callout_stop(lle-lle_timer); /* XXX: LOR avoidance. We still have ref on lle. */ LLE_WUNLOCK(lle); @@ -453,7 +453,7 @@ retry: LLE_ADDREF(la); la-la_expire = time_uptime; - canceled = callout_reset(la-la_timer, hz * V_arpt_down, + canceled = callout_reset(la-lle_timer, hz * V_arpt_down, arptimer, la); if (canceled) LLE_REMREF(la); @@ -793,7 +793,7 @@ match: LLE_ADDREF(la); la-la_expire = time_uptime + V_arpt_keep; - canceled = callout_reset(la-la_timer, + canceled = callout_reset(la-lle_timer, hz * V_arpt_keep, arptimer, la); if (canceled) LLE_REMREF(la); Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Tue Aug 11 12:38:01 2015(r286628) +++ head/sys/netinet/in.c Tue Aug 11 12:38:54 2015(r286629) @@ -996,7 +996,7 @@ in_lltable_new(struct in_addr addr4, u_i lle-base.lle_refcnt = 1; lle-base.lle_free = in_lltable_destroy_lle; LLE_LOCK_INIT(lle-base); - callout_init(lle-base.la_timer, 1); + callout_init(lle-base.lle_timer, 1); return (lle-base); } @@ -1039,7 +1039,7 @@ in_lltable_free_entry(struct lltable *ll } /* cancel timer */ - if (callout_stop(lle-la_timer)) + if (callout_stop(lle-lle_timer)) LLE_REMREF(lle); /* Drop hold queue */ Modified: head/sys/netinet6/in6.c == ---
Re: svn commit: r286625 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On Tue, Aug 11, 2015 at 10:39:20AM +, Alexander Motin wrote: Author: mav Date: Tue Aug 11 10:39:19 2015 New Revision: 286625 URL: https://svnweb.freebsd.org/changeset/base/286625 Log: MFV r277425: 5376 arc_kmem_reap_now() should not result in clearing arc_no_grow Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Steven Hartland kill...@multiplay.co.uk Reviewed by: Richard Elling richard.ell...@richardelling.com Approved by: Dan McDonald dan...@omniti.com Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 09:26:11 2015(r286624) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 10:39:19 2015(r286625) @@ -153,13 +153,7 @@ static kmutex_t arc_reclaim_thr_lock; static kcondvar_tarc_reclaim_thr_cv; /* used to signal reclaim thr */ static uint8_t arc_thread_exit; -#define ARC_REDUCE_DNLC_PERCENT 3 -uint_t arc_reduce_dnlc_percent = ARC_REDUCE_DNLC_PERCENT; - -typedef enum arc_reclaim_strategy { - ARC_RECLAIM_AGGR, /* Aggressive reclaim strategy */ - ARC_RECLAIM_CONS/* Conservative reclaim strategy */ -} arc_reclaim_strategy_t; +uint_t arc_reduce_dnlc_percent = 3; /* * The number of iterations through arc_evict_*() before we @@ -174,7 +168,19 @@ static int arc_grow_retry = 60; static int arc_p_min_shift = 4; /* log2(fraction of arc to reclaim) */ -static int arc_shrink_shift = 5; +static int arc_shrink_shift = 7; + +/* + * log2(fraction of ARC which must be free to allow growing). + * I.e. If there is less than arc_c arc_no_grow_shift free memory, + * when reading a new block into the ARC, we will evict an equal-sized block + * from the ARC. + * + * This must be less than arc_shrink_shift, so that when we shrink the ARC, + * we will still not allow it to grow. + */ +int arc_no_grow_shift = 5; + /* * minimum lifespan of a prefetch block in clock ticks @@ -3055,13 +3061,10 @@ arc_flush(spa_t *spa) } void -arc_shrink(void) +arc_shrink(int64_t to_free) { if (arc_c arc_c_min) { - uint64_t to_free; - - to_free = arc_c arc_shrink_shift; DTRACE_PROBE4(arc__shrink, uint64_t, arc_c, uint64_t, arc_c_min, uint64_t, arc_p, uint64_t, to_free); if (arc_c arc_c_min + to_free) @@ -3089,44 +3092,76 @@ arc_shrink(void) } } -static int needfree = 0; +static long needfree = 0; -static int -arc_reclaim_needed(void) +typedef enum free_memory_reason_t { + FMR_UNKNOWN, + FMR_NEEDFREE, + FMR_LOTSFREE, + FMR_SWAPFS_MINFREE, + FMR_PAGES_PP_MAXIMUM, + FMR_HEAP_ARENA, + FMR_ZIO_ARENA, + FMR_ZIO_FRAG, +} free_memory_reason_t; + +int64_t last_free_memory; +free_memory_reason_t last_free_reason; + +/* + * Additional reserve of pages for pp_reserve. + */ +int64_t arc_pages_pp_reserve = 64; + +/* + * Additional reserve of pages for swapfs. + */ +int64_t arc_swapfs_reserve = 64; + +/* + * Return the amount of memory that can be consumed before reclaim will be + * needed. Positive if there is sufficient free memory, negative indicates + * the amount of memory that needs to be freed up. + */ +static int64_t +arc_available_memory(void) { + int64_t lowest = INT64_MAX; + int64_t n; + free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL - - if (needfree) { - DTRACE_PROBE(arc__reclaim_needfree); - return (1); + if (needfree 0) { + n = PAGESIZE * (-needfree); + if (n lowest) { + lowest = n; + r = FMR_NEEDFREE; + } } /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - if (freemem zfs_arc_free_target) { - DTRACE_PROBE2(arc__reclaim_freemem, uint64_t, - freemem, uint64_t, zfs_arc_free_target); - return (1); + n = PAGESIZE * (int64_t)(freemem - zfs_arc_free_target); + if (n lowest) { + lowest = n; + r = FMR_LOTSFREE; } #ifdef illumos /* - * take 'desfree' extra pages, so we reclaim sooner, rather than later - */ - extra = desfree; - - /* * check that we're out of range of the pageout scanner. It starts to * schedule paging
svn commit: r286626 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Tue Aug 11 12:22:16 2015 New Revision: 286626 URL: https://svnweb.freebsd.org/changeset/base/286626 Log: Fix minor mismerge in r286574. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 10:39:19 2015(r286625) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 12:22:16 2015(r286626) @@ -4729,48 +4729,6 @@ arc_memory_throttle(uint64_t reserve, ui return (0); } -static void -arc_kstat_update_state(arc_state_t *state, kstat_named_t *size, -kstat_named_t *evict_data, kstat_named_t *evict_metadata) -{ - size-value.ui64 = state-arcs_size; - evict_data-value.ui64 = state-arcs_lsize[ARC_BUFC_DATA]; - evict_metadata-value.ui64 = state-arcs_lsize[ARC_BUFC_METADATA]; -} - -static int -arc_kstat_update(kstat_t *ksp, int rw) -{ - arc_stats_t *as = ksp-ks_data; - - if (rw == KSTAT_WRITE) { - return (EACCES); - } else { - arc_kstat_update_state(arc_anon, - as-arcstat_anon_size, - as-arcstat_anon_evictable_data, - as-arcstat_anon_evictable_metadata); - arc_kstat_update_state(arc_mru, - as-arcstat_mru_size, - as-arcstat_mru_evictable_data, - as-arcstat_mru_evictable_metadata); - arc_kstat_update_state(arc_mru_ghost, - as-arcstat_mru_ghost_size, - as-arcstat_mru_ghost_evictable_data, - as-arcstat_mru_ghost_evictable_metadata); - arc_kstat_update_state(arc_mfu, - as-arcstat_mfu_size, - as-arcstat_mfu_evictable_data, - as-arcstat_mfu_evictable_metadata); - arc_kstat_update_state(arc_mfu_ghost, - as-arcstat_mfu_ghost_size, - as-arcstat_mfu_ghost_evictable_data, - as-arcstat_mfu_ghost_evictable_metadata); - } - - return (0); -} - void arc_tempreserve_clear(uint64_t reserve) { @@ -4829,6 +4787,48 @@ arc_tempreserve_space(uint64_t reserve, return (0); } +static void +arc_kstat_update_state(arc_state_t *state, kstat_named_t *size, +kstat_named_t *evict_data, kstat_named_t *evict_metadata) +{ + size-value.ui64 = state-arcs_size; + evict_data-value.ui64 = state-arcs_lsize[ARC_BUFC_DATA]; + evict_metadata-value.ui64 = state-arcs_lsize[ARC_BUFC_METADATA]; +} + +static int +arc_kstat_update(kstat_t *ksp, int rw) +{ + arc_stats_t *as = ksp-ks_data; + + if (rw == KSTAT_WRITE) { + return (EACCES); + } else { + arc_kstat_update_state(arc_anon, + as-arcstat_anon_size, + as-arcstat_anon_evictable_data, + as-arcstat_anon_evictable_metadata); + arc_kstat_update_state(arc_mru, + as-arcstat_mru_size, + as-arcstat_mru_evictable_data, + as-arcstat_mru_evictable_metadata); + arc_kstat_update_state(arc_mru_ghost, + as-arcstat_mru_ghost_size, + as-arcstat_mru_ghost_evictable_data, + as-arcstat_mru_ghost_evictable_metadata); + arc_kstat_update_state(arc_mfu, + as-arcstat_mfu_size, + as-arcstat_mfu_evictable_data, + as-arcstat_mfu_evictable_metadata); + arc_kstat_update_state(arc_mfu_ghost, + as-arcstat_mfu_ghost_size, + as-arcstat_mfu_ghost_evictable_data, + as-arcstat_mfu_ghost_evictable_metadata); + } + + return (0); +} + #ifdef _KERNEL static eventhandler_tag arc_event_lowmem = NULL; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286437 - in head/sys: dev/ath dev/ath/ath_rate/sample dev/bwi dev/bwn dev/if_ndis dev/ipw dev/iwi dev/iwn dev/malo dev/mwl dev/ral dev/usb/wlan dev/wi dev/wpi dev/wtap net80211
On Sat, Aug 08, 2015 at 01:10:19AM +, Adrian Chadd wrote: A Author: adrian A Date: Sat Aug 8 01:10:17 2015 A New Revision: 286437 A URL: https://svnweb.freebsd.org/changeset/base/286437 A A Log: A Revert the wifi ifnet changes until things are more baked and tested. A A * 286410 A * 286413 A * 286416 A A The initial commit broke a variety of debug and features that aren't A in the GENERIC kernels but are enabled in other platforms. Here is latest patch, that passes all universe kernels. -- Totus tuus, Glebius. net80211.diff.bz2 Description: Binary data ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286627 - head/sys/arm64/arm64
Author: andrew Date: Tue Aug 11 12:32:17 2015 New Revision: 286627 URL: https://svnweb.freebsd.org/changeset/base/286627 Log: Check the correct value in db_validate_address, pmap_extract returns 0 on failure. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/db_interface.c Modified: head/sys/arm64/arm64/db_interface.c == --- head/sys/arm64/arm64/db_interface.c Tue Aug 11 12:22:16 2015 (r286626) +++ head/sys/arm64/arm64/db_interface.c Tue Aug 11 12:32:17 2015 (r286627) @@ -119,7 +119,7 @@ db_validate_address(vm_offset_t addr) else pmap = p-p_vmspace-vm_map.pmap; - return (pmap_extract(pmap, addr) == FALSE); + return (pmap_extract(pmap, addr) != 0); } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286625 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On 11/08/2015 13:39, Alexander Motin wrote: Author: mav Date: Tue Aug 11 10:39:19 2015 New Revision: 286625 URL: https://svnweb.freebsd.org/changeset/base/286625 Log: MFV r277425: 5376 arc_kmem_reap_now() should not result in clearing arc_no_grow Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Steven Hartland kill...@multiplay.co.uk Reviewed by: Richard Elling richard.ell...@richardelling.com Approved by: Dan McDonald dan...@omniti.com Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Alexander, thank you very much for bringing all these upstream changes into our tree. It seems that some of the changes, though, non-trivially overlap with FreeBSD-specific changes to ZFS code. I think that this change is one of the examples. It would be good if a strategy of the resolution of each non-trivial conflict was described and possibly discussed. Reviewing the change without knowing the general idea behind it is not always easy. -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286625 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Tue Aug 11 10:39:19 2015 New Revision: 286625 URL: https://svnweb.freebsd.org/changeset/base/286625 Log: MFV r277425: 5376 arc_kmem_reap_now() should not result in clearing arc_no_grow Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Steven Hartland kill...@multiplay.co.uk Reviewed by: Richard Elling richard.ell...@richardelling.com Approved by: Dan McDonald dan...@omniti.com Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 09:26:11 2015(r286624) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 10:39:19 2015(r286625) @@ -153,13 +153,7 @@ static kmutex_tarc_reclaim_thr_lock; static kcondvar_t arc_reclaim_thr_cv; /* used to signal reclaim thr */ static uint8_t arc_thread_exit; -#defineARC_REDUCE_DNLC_PERCENT 3 -uint_t arc_reduce_dnlc_percent = ARC_REDUCE_DNLC_PERCENT; - -typedef enum arc_reclaim_strategy { - ARC_RECLAIM_AGGR, /* Aggressive reclaim strategy */ - ARC_RECLAIM_CONS/* Conservative reclaim strategy */ -} arc_reclaim_strategy_t; +uint_t arc_reduce_dnlc_percent = 3; /* * The number of iterations through arc_evict_*() before we @@ -174,7 +168,19 @@ static int arc_grow_retry = 60; static int arc_p_min_shift = 4; /* log2(fraction of arc to reclaim) */ -static int arc_shrink_shift = 5; +static int arc_shrink_shift = 7; + +/* + * log2(fraction of ARC which must be free to allow growing). + * I.e. If there is less than arc_c arc_no_grow_shift free memory, + * when reading a new block into the ARC, we will evict an equal-sized block + * from the ARC. + * + * This must be less than arc_shrink_shift, so that when we shrink the ARC, + * we will still not allow it to grow. + */ +intarc_no_grow_shift = 5; + /* * minimum lifespan of a prefetch block in clock ticks @@ -3055,13 +3061,10 @@ arc_flush(spa_t *spa) } void -arc_shrink(void) +arc_shrink(int64_t to_free) { if (arc_c arc_c_min) { - uint64_t to_free; - - to_free = arc_c arc_shrink_shift; DTRACE_PROBE4(arc__shrink, uint64_t, arc_c, uint64_t, arc_c_min, uint64_t, arc_p, uint64_t, to_free); if (arc_c arc_c_min + to_free) @@ -3089,44 +3092,76 @@ arc_shrink(void) } } -static int needfree = 0; +static long needfree = 0; -static int -arc_reclaim_needed(void) +typedef enum free_memory_reason_t { + FMR_UNKNOWN, + FMR_NEEDFREE, + FMR_LOTSFREE, + FMR_SWAPFS_MINFREE, + FMR_PAGES_PP_MAXIMUM, + FMR_HEAP_ARENA, + FMR_ZIO_ARENA, + FMR_ZIO_FRAG, +} free_memory_reason_t; + +int64_t last_free_memory; +free_memory_reason_t last_free_reason; + +/* + * Additional reserve of pages for pp_reserve. + */ +int64_t arc_pages_pp_reserve = 64; + +/* + * Additional reserve of pages for swapfs. + */ +int64_t arc_swapfs_reserve = 64; + +/* + * Return the amount of memory that can be consumed before reclaim will be + * needed. Positive if there is sufficient free memory, negative indicates + * the amount of memory that needs to be freed up. + */ +static int64_t +arc_available_memory(void) { + int64_t lowest = INT64_MAX; + int64_t n; + free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL - - if (needfree) { - DTRACE_PROBE(arc__reclaim_needfree); - return (1); + if (needfree 0) { + n = PAGESIZE * (-needfree); + if (n lowest) { + lowest = n; + r = FMR_NEEDFREE; + } } /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - if (freemem zfs_arc_free_target) { - DTRACE_PROBE2(arc__reclaim_freemem, uint64_t, - freemem, uint64_t, zfs_arc_free_target); - return (1); + n = PAGESIZE * (int64_t)(freemem - zfs_arc_free_target); + if (n lowest) { + lowest = n; + r = FMR_LOTSFREE; } #ifdef illumos /* -* take 'desfree' extra pages, so we reclaim sooner, rather than later -*/ - extra = desfree; - - /* * check that we're out of range of the pageout scanner. It starts to * schedule paging if freemem is less than lotsfree and needfree. * lotsfree is the high-water mark for pageout, and needfree
svn commit: r286628 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Tue Aug 11 12:38:01 2015 New Revision: 286628 URL: https://svnweb.freebsd.org/changeset/base/286628 Log: Fix r286625 build on i386. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 12:32:17 2015(r286627) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 12:38:01 2015(r286628) @@ -3206,7 +3206,7 @@ arc_available_memory(void) * free) */ n = vmem_size(heap_arena, VMEM_FREE) - - (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) 2) + (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) 2); if (n lowest) { lowest = n; r = FMR_HEAP_ARENA; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286631 - in head/sys: kern sys
Author: ed Date: Tue Aug 11 13:47:23 2015 New Revision: 286631 URL: https://svnweb.freebsd.org/changeset/base/286631 Log: Add support for anonymous kqueues. CloudABI's polling system calls merge the concept of one-shot polling (poll, select) and stateful polling (kqueue). They share the same data structures. Extend FreeBSD's kqueue to provide support for waiting for events on an anonymous kqueue. Unlike stateful polling, there is no need to support timeouts, as an additional timer event could be used instead. Furthermore, it makes no sense to use a different number of input and output kevents. Merge this into a single argument. Obtained from:https://github.com/NuxiNL/freebsd Differential Revision:https://reviews.freebsd.org/D3307 Modified: head/sys/kern/kern_event.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Tue Aug 11 13:42:58 2015(r286630) +++ head/sys/kern/kern_event.c Tue Aug 11 13:47:23 2015(r286631) @@ -99,6 +99,8 @@ static intkqueue_register(struct kqueue struct thread *td, int waitok); static int kqueue_acquire(struct file *fp, struct kqueue **kqp); static voidkqueue_release(struct kqueue *kq, int locked); +static voidkqueue_destroy(struct kqueue *kq); +static voidkqueue_drain(struct kqueue *kq, struct thread *td); static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, int waitok); static voidkqueue_task(void *arg, int pending); @@ -741,6 +743,16 @@ sys_kqueue(struct thread *td, struct kqu return (kern_kqueue(td, 0, NULL)); } +static void +kqueue_init(struct kqueue *kq) +{ + + mtx_init(kq-kq_lock, kqueue, NULL, MTX_DEF | MTX_DUPOK); + TAILQ_INIT(kq-kq_head); + knlist_init_mtx(kq-kq_sel.si_note, kq-kq_lock); + TASK_INIT(kq-kq_task, 0, kqueue_task, kq); +} + int kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps) { @@ -766,12 +778,9 @@ kern_kqueue(struct thread *td, int flags /* An extra reference on `fp' has been held for us by falloc(). */ kq = malloc(sizeof *kq, M_KQUEUE, M_WAITOK | M_ZERO); - mtx_init(kq-kq_lock, kqueue, NULL, MTX_DEF|MTX_DUPOK); - TAILQ_INIT(kq-kq_head); + kqueue_init(kq); kq-kq_fdp = fdp; kq-kq_cred = cred; - knlist_init_mtx(kq-kq_sel.si_note, kq-kq_lock); - TASK_INIT(kq-kq_task, 0, kqueue_task, kq); FILEDESC_XLOCK(fdp); TAILQ_INSERT_HEAD(fdp-fd_kqlist, kq, kq_list); @@ -910,26 +919,20 @@ kern_kevent(struct thread *td, int fd, i return (error); } -int -kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, int nevents, +static int +kqueue_kevent(struct kqueue *kq, struct thread *td, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout) { struct kevent keva[KQ_NEVENTS]; struct kevent *kevp, *changes; - struct kqueue *kq; int i, n, nerrors, error; - error = kqueue_acquire(fp, kq); - if (error != 0) - return (error); - nerrors = 0; - while (nchanges 0) { n = nchanges KQ_NEVENTS ? KQ_NEVENTS : nchanges; error = k_ops-k_copyin(k_ops-arg, keva, n); if (error) - goto done; + return (error); changes = keva; for (i = 0; i n; i++) { kevp = changes[i]; @@ -938,33 +941,56 @@ kern_kevent_fp(struct thread *td, struct kevp-flags = ~EV_SYSFLAGS; error = kqueue_register(kq, kevp, td, 1); if (error || (kevp-flags EV_RECEIPT)) { - if (nevents != 0) { - kevp-flags = EV_ERROR; - kevp-data = error; - (void) k_ops-k_copyout(k_ops-arg, - kevp, 1); - nevents--; - nerrors++; - } else { - goto done; - } + if (nevents == 0) + return (error); + kevp-flags = EV_ERROR; + kevp-data = error; + (void)k_ops-k_copyout(k_ops-arg, kevp, 1); + nevents--; + nerrors++; } } nchanges -= n; } if (nerrors) { td-td_retval[0] = nerrors; - error = 0; - goto
Re: svn commit: r286524 - in head: . etc sys/dev/drm sys/dev/drm2
Hi Koop, 2015-08-09 14:58 GMT+02:00 Koop Mast k...@freebsd.org: +#define DRM_DEV_GID44 /* video group */ I think it looks a bit weird that DRM has these definitions locally. sys/conf.h already has definitions for various users and groups (UID_* and GID_*). Would it make sense to add GID_VIDEO to sys/conf.h and change the definitions in drmP.h to the following? #define DRM_DEV_UID UID_ROOT #define DRM_DEV_GID GID_VIDEO -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286630 - head/sys/dev/psci
Author: andrew Date: Tue Aug 11 13:42:58 2015 New Revision: 286630 URL: https://svnweb.freebsd.org/changeset/base/286630 Log: Start to support PSCI 1.0. For all the functions we currently support this can be seen as the same as 0.2. There are changes with the data passed to CPU_SUSPEND, however we don't yet use this call. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c == --- head/sys/dev/psci/psci.cTue Aug 11 12:38:54 2015(r286629) +++ head/sys/dev/psci/psci.cTue Aug 11 13:42:58 2015(r286630) @@ -288,20 +288,21 @@ psci_v0_2_init(device_t dev) if (version == PSCI_RETVAL_NOT_SUPPORTED) return (1); - if ((PSCI_VER_MAJOR(version) != 0) (PSCI_VER_MINOR(version) != 2)) { - device_printf(dev, PSCI version number mismatched with DT\n); - return (1); - } + if ((PSCI_VER_MAJOR(version) == 0 PSCI_VER_MINOR(version) == 2) || + (PSCI_VER_MAJOR(version) == 1 PSCI_VER_MINOR(version) == 0)) { + if (bootverbose) + device_printf(dev, PSCI version 0.2 available\n); - if (bootverbose) - device_printf(dev, PSCI version 0.2 available\n); + /* +* We only register this for v0.2 since v0.1 doesn't support +* system_reset. +*/ + EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, + SHUTDOWN_PRI_LAST); - /* -* We only register this for v0.2 since v0.1 doesn't support -* system_reset. -*/ - EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, - SHUTDOWN_PRI_LAST); + return (0); + } - return (0); + device_printf(dev, PSCI version number mismatched with DT\n); + return (1); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286524 - in head: . etc sys/dev/drm sys/dev/drm2
On Mon, 2015-08-10 at 02:15 +0200, Jan Beich wrote: Koop Mast k...@freebsd.org writes: Author: kwm (ports committer) Date: Sun Aug 9 12:58:56 2015 New Revision: 286524 URL: https://svnweb.freebsd.org/changeset/base/286524 Log: Add a new group named 'video' with the id of 44. And make drm create devices in /dev/dri/ with this new group. Would 'video' group include capture devices as well? Linux seems to mix /dev/nvidia*, /dev/fb* and /dev/video* all under same group despite all of them have different attack vectors. We could extend this, but the only example I had where the dri devices. Also webcamd already chmod's it's devices: % ll /dev/video0 crw-rw 1 webcamd webcamd 0x9a Aug 10 07:35 /dev/video0 I'm unsure if nvidia makes any /dev devices since it been ages since I had one in a machine of mine. Modified: head/sys/dev/drm/drmP.h === === --- head/sys/dev/drm/drmP.h Sun Aug 9 12:20:22 2015 (r286523) +++ head/sys/dev/drm/drmP.h Sun Aug 9 12:58:56 2015 (r286524) @@ -175,7 +175,7 @@ SYSCTL_DECL(_hw_drm); #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) #define DRM_DEV_UID0 -#define DRM_DEV_GID0 +#define DRM_DEV_GID44 /* video group */ Why hardcode? Linux often uses udev(7) rules to assign a group which on FreeBSD can easily be translated into devd.conf(5) or devfs.rules(5). Having 'video' assigned by kernel wouldn't eliminate having to run mergemaster/etcupdate + pw groupmod on upgrade. I find this way easier to do. However with the devd.conf(5) or devfs.rules(5) someone still needs to up date the /etc and pw groupmod. -Koop ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286632 - head/sys/compat/cloudabi
Author: ed Date: Tue Aug 11 14:07:04 2015 New Revision: 286632 URL: https://svnweb.freebsd.org/changeset/base/286632 Log: Properly convert the error number to CloudABI's indexing. We currently return FreeBSD's errno value directly, which is of course not correct. Modified: head/sys/compat/cloudabi/cloudabi_sock.c Modified: head/sys/compat/cloudabi/cloudabi_sock.c == --- head/sys/compat/cloudabi/cloudabi_sock.cTue Aug 11 13:47:23 2015 (r286631) +++ head/sys/compat/cloudabi/cloudabi_sock.cTue Aug 11 14:07:04 2015 (r286632) @@ -236,7 +236,7 @@ cloudabi_sys_sock_stat_get(struct thread /* Set ss_error. */ SOCK_LOCK(so); - ss.ss_error = so-so_error; + ss.ss_error = cloudabi_convert_errno(so-so_error); if ((uap-flags CLOUDABI_SOCKSTAT_CLEAR_ERROR) != 0) so-so_error = 0; SOCK_UNLOCK(so); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286633 - head/sys/compat/cloudabi
Author: ed Date: Tue Aug 11 14:08:46 2015 New Revision: 286633 URL: https://svnweb.freebsd.org/changeset/base/286633 Log: Fall back to O_RDONLY -- not O_WRONLY. If CloudABI processes open files with a set of requested rights that do not match any of the privileges granted by O_RDONLY, O_WRONLY or O_RDWR, we'd better fall back to O_RDONLY -- not O_WRONLY. Modified: head/sys/compat/cloudabi/cloudabi_file.c Modified: head/sys/compat/cloudabi/cloudabi_file.c == --- head/sys/compat/cloudabi/cloudabi_file.cTue Aug 11 14:07:04 2015 (r286632) +++ head/sys/compat/cloudabi/cloudabi_file.cTue Aug 11 14:08:46 2015 (r286633) @@ -224,7 +224,7 @@ cloudabi_sys_file_open(struct thread *td write = (fds.fs_rights_base (CLOUDABI_RIGHT_FD_DATASYNC | CLOUDABI_RIGHT_FD_WRITE | CLOUDABI_RIGHT_FILE_ALLOCATE | CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE)) != 0; - fflags = read ? write ? FREAD | FWRITE : FREAD : FWRITE; + fflags = write ? read ? FREAD | FWRITE : FWRITE : FREAD; /* Convert open flags. */ if ((uap-oflags CLOUDABI_O_CREAT) != 0) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286524 - in head: . etc sys/dev/drm sys/dev/drm2
On Aug 11, 2015, at 7:53 AM, Koop Mast k...@freebsd.org wrote: On Mon, 2015-08-10 at 02:15 +0200, Jan Beich wrote: Koop Mast k...@freebsd.org writes: Author: kwm (ports committer) Date: Sun Aug 9 12:58:56 2015 New Revision: 286524 URL: https://svnweb.freebsd.org/changeset/base/286524 Log: Add a new group named 'video' with the id of 44. And make drm create devices in /dev/dri/ with this new group. Would 'video' group include capture devices as well? Linux seems to mix /dev/nvidia*, /dev/fb* and /dev/video* all under same group despite all of them have different attack vectors. We could extend this, but the only example I had where the dri devices. Also webcamd already chmod's it's devices: % ll /dev/video0 crw-rw 1 webcamd webcamd 0x9a Aug 10 07:35 /dev/video0 I'm unsure if nvidia makes any /dev devices since it been ages since I had one in a machine of mine. Modified: head/sys/dev/drm/drmP.h === === --- head/sys/dev/drm/drmP.h Sun Aug 9 12:20:22 2015 (r286523) +++ head/sys/dev/drm/drmP.h Sun Aug 9 12:58:56 2015 (r286524) @@ -175,7 +175,7 @@ SYSCTL_DECL(_hw_drm); #define DRM_DEV_MODE(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) #define DRM_DEV_UID 0 -#define DRM_DEV_GID0 +#define DRM_DEV_GID44 /* video group */ Why hardcode? Linux often uses udev(7) rules to assign a group which on FreeBSD can easily be translated into devd.conf(5) or devfs.rules(5). Having 'video' assigned by kernel wouldn't eliminate having to run mergemaster/etcupdate + pw groupmod on upgrade. I find this way easier to do. However with the devd.conf(5) or devfs.rules(5) someone still needs to up date the /etc and pw groupmod. devd.conf isn’t the place for this. This is pure devfs.rules. Warner signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r286620 - head/contrib/netbsd-tests/lib/libc/regex
On Tue, Aug 11, 2015 at 10:22:12AM -0400, Benjamin Kaduk wrote: On Tue, Aug 11, 2015 at 4:57 AM, Baptiste Daroussin b...@freebsd.org wrote: Author: bapt Date: Tue Aug 11 08:57:04 2015 New Revision: 286620 URL: https://svnweb.freebsd.org/changeset/base/286620 Log: Disable broken test until we have time ti actually fix the test Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c == --- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:44:19 2015(r286619) +++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:57:04 2015(r286620) @@ -631,7 +631,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, categorization); ATF_TP_ADD_TC(tp, nullsubexpr); - ATF_TP_ADD_TC(tp, leftassoc); +// ATF_TP_ADD_TC(tp, leftassoc); style still doesn't like C++-style comments... -Ben This is a temporary disable, do we really care? Bapt pgpRGZwrRhbmj.pgp Description: PGP signature
Re: svn commit: r286620 - head/contrib/netbsd-tests/lib/libc/regex
On Tue, Aug 11, 2015 at 4:57 AM, Baptiste Daroussin b...@freebsd.org wrote: Author: bapt Date: Tue Aug 11 08:57:04 2015 New Revision: 286620 URL: https://svnweb.freebsd.org/changeset/base/286620 Log: Disable broken test until we have time ti actually fix the test Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c == --- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:44:19 2015(r286619) +++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 08:57:04 2015(r286620) @@ -631,7 +631,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, categorization); ATF_TP_ADD_TC(tp, nullsubexpr); - ATF_TP_ADD_TC(tp, leftassoc); +// ATF_TP_ADD_TC(tp, leftassoc); style still doesn't like C++-style comments... -Ben ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286639 - head/lib/libc/tests/locale
2015-08-11 18:08 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Actually disable the invalid test I thought mbrtowc_test was the one that was failing -- not mbstowcs_test. Why not simply remove the bad test vectors? -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286491 - head/lib/libc/locale
On Tue, Aug 11, 2015 at 06:28:06PM +0200, Ed Schouten wrote: 2015-08-09 2:06 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Per rfc3629 value greater than 0x10 should be rejected Not only that, values between 0xd800 and 0xdfff also need to be rejected: diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 55e2931..8ccfdb1 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -318,6 +318,10 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) lead = 0xc0; len = 2; } else if ((wc ~0x) == 0) { + if (wc = 0xd800 wc = 0xdfff) { + errno = EILSEQ; + return ((size_t)-1); + } lead = 0xe0; len = 3; } else if (wc = 0 wc = 0x10) { Good catch please go ahead Bapt pgptqT6iKKWQt.pgp Description: PGP signature
Re: svn commit: r286625 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On 11/08/2015 11:51, Andriy Gapon wrote: On 11/08/2015 13:39, Alexander Motin wrote: Author: mav Date: Tue Aug 11 10:39:19 2015 New Revision: 286625 URL: https://svnweb.freebsd.org/changeset/base/286625 Log: MFV r277425: 5376 arc_kmem_reap_now() should not result in clearing arc_no_grow Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Steven Hartland kill...@multiplay.co.uk Reviewed by: Richard Elling richard.ell...@richardelling.com Approved by: Dan McDonald dan...@omniti.com Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Alexander, thank you very much for bringing all these upstream changes into our tree. It seems that some of the changes, though, non-trivially overlap with FreeBSD-specific changes to ZFS code. I think that this change is one of the examples. It would be good if a strategy of the resolution of each non-trivial conflict was described and possibly discussed. Reviewing the change without knowing the general idea behind it is not always easy. I actually eliminated most of the miss-matches between illumos and FreeBSD in this area pretty recently, so I'm not sure that there's actually many FreeBSD specific changes, hence conflicts. Given I worked in this area before I did also make a point of reviewing the upstream commit. That's not to say it wouldn't be good to review these sorts of changes especially given the potential impact, however we don't have a very good track record (myself included) in reviewing things so I'm concerned that would just become a real progress blocker. What do others think? Regards Steve ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286640 - in head/sys: dev/drm dev/drm2 sys
Author: kwm (ports committer) Date: Tue Aug 11 16:51:44 2015 New Revision: 286640 URL: https://svnweb.freebsd.org/changeset/base/286640 Log: Instead of defining the actualy user and group id in the drmP.h files define GID_VIDEO in sys/conf.h, and use it together with UID_ROOT to define DRM_DEV_UID and DRM_DEV_GID in the drmP.h files. So there is one place where the UID's and GID's are defined. Submitted by: ed@ Reviewed by: ed@, dumbbell@ Differential Revision:https://reviews.freebsd.org/D3360 Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm2/drmP.h head/sys/sys/conf.h Modified: head/sys/dev/drm/drmP.h == --- head/sys/dev/drm/drmP.h Tue Aug 11 16:08:10 2015(r286639) +++ head/sys/dev/drm/drmP.h Tue Aug 11 16:51:44 2015(r286640) @@ -174,8 +174,8 @@ SYSCTL_DECL(_hw_drm); #define __OS_HAS_AGP 1 #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) -#define DRM_DEV_UID0 -#define DRM_DEV_GID44 /* video group */ +#define DRM_DEV_UIDUID_ROOT +#define DRM_DEV_GIDGID_VIDEO #define wait_queue_head_t atomic_t #define DRM_WAKEUP(w) wakeup((void *)w) Modified: head/sys/dev/drm2/drmP.h == --- head/sys/dev/drm2/drmP.hTue Aug 11 16:08:10 2015(r286639) +++ head/sys/dev/drm2/drmP.hTue Aug 11 16:51:44 2015(r286640) @@ -1592,8 +1592,8 @@ extern int drm_pcie_get_speed_cap_mask(s SYSCTL_DECL(_hw_drm); #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) -#define DRM_DEV_UID0 -#define DRM_DEV_GID44 /* video group */ +#define DRM_DEV_UIDUID_ROOT +#define DRM_DEV_GIDGID_VIDEO #define DRM_WAKEUP(w) wakeup((void *)w) #define DRM_WAKEUP_INT(w) wakeup(w) Modified: head/sys/sys/conf.h == --- head/sys/sys/conf.h Tue Aug 11 16:08:10 2015(r286639) +++ head/sys/sys/conf.h Tue Aug 11 16:51:44 2015(r286640) @@ -299,6 +299,7 @@ voiddevfs_free_cdp_inode(ino_t ino); #defineGID_OPERATOR5 #defineGID_BIN 7 #defineGID_GAMES 13 +#defineGID_VIDEO 44 #defineGID_DIALER 68 #defineGID_NOBODY 65534 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286635 - head
Author: emaste Date: Tue Aug 11 15:43:09 2015 New Revision: 286635 URL: https://svnweb.freebsd.org/changeset/base/286635 Log: Build libelf and libdwarf in the legacy stage They need to be built and installed (including headers) prior to the DTrace CTF tools. Reviewed by: imp (as part of a larger change) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Aug 11 15:25:08 2015(r286634) +++ head/Makefile.inc1 Tue Aug 11 15:43:09 2015(r286635) @@ -1229,12 +1229,18 @@ update: # set of tools and shims necessary to compensate for older systems which don't have # the APIs that the targets built in bootstrap-tools, build-tools or cross-tools. # + +# ELF Tool Chain libraries are needed for ELF tools and dtrace tools. +.if ${BOOTSTRAPPING} 116 +_elftoolchain_libs= lib/libelf lib/libdwarf +.endif + legacy: .if ${BOOTSTRAPPING} 800107 ${BOOTSTRAPPING} != 0 @echo ERROR: Source upgrades from versions prior to 8.0 not supported.; \ false .endif -.for _tool in tools/build +.for _tool in tools/build ${_elftoolchain_libs} ${_+_}@${ECHODIR} === ${_tool} (obj,includes,depend,all,install); \ cd ${.CURDIR}/${_tool} \ ${MAKE} DIRPRFX=${_tool}/ obj \ @@ -1332,13 +1338,12 @@ ${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/ # pre libdwarf .if ${BOOTSTRAPPING} 116 || (${MACHINE} != ${TARGET} || \ ${MACHINE_ARCH} != ${TARGET_ARCH}) -_elftoolchain_libs= lib/libelf lib/libdwarf .if ${MK_CDDL} != no _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf cddl/usr.bin/ctfconvert \ cddl/usr.bin/ctfmerge -${_bt}-cddl/usr.bin/ctfconvert: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf -${_bt}-cddl/usr.bin/ctfmerge: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf +${_bt}-cddl/usr.bin/ctfconvert: ${_bt}-cddl/lib/libctf +${_bt}-cddl/usr.bin/ctfmerge: ${_bt}-cddl/lib/libctf .endif .endif @@ -1381,7 +1386,6 @@ bootstrap-tools: .PHONY .for _tool in \ ${_clang_tblgen} \ ${_kerberos5_bootstrap_tools} \ -${_elftoolchain_libs} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286490 - head/lib/libc/locale
2015-08-09 1:59 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. Per rfc3629 value greater than 0x10 should be rejected I think the change you made only ensures that the value cannot exceed 0x1f -- not 0x10. You probably need to do something like this: diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 55e2931..8ccfdb1 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -191,7 +191,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, errno = EILSEQ; return ((size_t)-1); } - if (wch = 0xd800 wch = 0xdfff) { + if ((wch = 0xd800 wch = 0xdfff) || wch 0x10) { /* * Malformed input; invalid code points. */ -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286490 - head/lib/libc/locale
On Tue, Aug 11, 2015 at 06:27:01PM +0200, Ed Schouten wrote: 2015-08-09 1:59 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. Per rfc3629 value greater than 0x10 should be rejected I think the change you made only ensures that the value cannot exceed 0x1f -- not 0x10. You probably need to do something like this: diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 55e2931..8ccfdb1 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -191,7 +191,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, errno = EILSEQ; return ((size_t)-1); } - if (wch = 0xd800 wch = 0xdfff) { + if ((wch = 0xd800 wch = 0xdfff) || wch 0x10) { /* * Malformed input; invalid code points. */ Please go ahead with that one. Best regards, Bapt pgpdYHpZoPjzN.pgp Description: PGP signature
svn commit: r286638 - head/contrib/netbsd-tests/lib/libc/regex
Author: bapt Date: Tue Aug 11 16:07:24 2015 New Revision: 286638 URL: https://svnweb.freebsd.org/changeset/base/286638 Log: Reenable the test. Sorry I was testing on the wrong branch. Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c == --- head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 16:01:34 2015(r286637) +++ head/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c Tue Aug 11 16:07:24 2015(r286638) @@ -631,7 +631,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, categorization); ATF_TP_ADD_TC(tp, nullsubexpr); -// ATF_TP_ADD_TC(tp, leftassoc); + ATF_TP_ADD_TC(tp, leftassoc); ATF_TP_ADD_TC(tp, rightassoc); ATF_TP_ADD_TC(tp, forcedassoc); ATF_TP_ADD_TC(tp, repetition); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286639 - head/lib/libc/tests/locale
Author: bapt Date: Tue Aug 11 16:08:10 2015 New Revision: 286639 URL: https://svnweb.freebsd.org/changeset/base/286639 Log: Actually disable the invalid test Modified: head/lib/libc/tests/locale/Makefile Modified: head/lib/libc/tests/locale/Makefile == --- head/lib/libc/tests/locale/Makefile Tue Aug 11 16:07:24 2015 (r286638) +++ head/lib/libc/tests/locale/Makefile Tue Aug 11 16:08:10 2015 (r286639) @@ -6,7 +6,7 @@ TESTSDIR= ${TESTSBASE}/lib/libc/locale NETBSD_ATF_TESTS_C=io_test NETBSD_ATF_TESTS_C+= mbrtowc_test -NETBSD_ATF_TESTS_C+= mbstowcs_test +#NETBSD_ATF_TESTS_C+= mbstowcs_test NETBSD_ATF_TESTS_C+= mbsnrtowcs_test NETBSD_ATF_TESTS_C+= mbtowc_test NETBSD_ATF_TESTS_C+= wcscspn_test ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286491 - head/lib/libc/locale
2015-08-09 2:06 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Per rfc3629 value greater than 0x10 should be rejected Not only that, values between 0xd800 and 0xdfff also need to be rejected: diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 55e2931..8ccfdb1 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -318,6 +318,10 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) lead = 0xc0; len = 2; } else if ((wc ~0x) == 0) { + if (wc = 0xd800 wc = 0xdfff) { + errno = EILSEQ; + return ((size_t)-1); + } lead = 0xe0; len = 3; } else if (wc = 0 wc = 0x10) { -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286639 - head/lib/libc/tests/locale
2015-08-11 18:18 GMT+02:00 Ed Schouten e...@nuxi.nl: 2015-08-11 18:08 GMT+02:00 Baptiste Daroussin b...@freebsd.org: Actually disable the invalid test I thought mbrtowc_test was the one that was failing -- not mbstowcs_test. Oh, wait. Both mbrtowc_test and mbstowcs_test are failing. -- Ed Schouten e...@nuxi.nl Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286644 - head/sys/contrib/libnv
Author: oshogbo Date: Tue Aug 11 17:54:51 2015 New Revision: 286644 URL: https://svnweb.freebsd.org/changeset/base/286644 Log: Don't set parent if the unpack operation fail. In some case this could crash the library, because of the NULL pointer references. Discovered thanks to american fuzzy lop. Approved by: pjd (mentor) Modified: head/sys/contrib/libnv/nvlist.c Modified: head/sys/contrib/libnv/nvlist.c == --- head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:48:58 2015 (r286643) +++ head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:54:51 2015 (r286644) @@ -824,6 +824,8 @@ nvlist_xunpack(const void *buf, size_t s case NV_TYPE_NVLIST: ptr = nvpair_unpack_nvlist(isbe, nvp, ptr, left, nfds, tmpnvl); + if (tmpnvl == NULL || ptr == NULL) + goto failed; nvlist_set_parent(tmpnvl, nvp); break; #ifndef _KERNEL ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286642 - in head: share/man/man9 sys/contrib/libnv
Author: oshogbo Date: Tue Aug 11 17:41:32 2015 New Revision: 286642 URL: https://svnweb.freebsd.org/changeset/base/286642 Log: Make the nvlist_next(9) function handle NULL pointer variable. This simplifies removing the first element from nvlist. Reviewed by: AllanJude Approved by: pjd (mentor) Modified: head/share/man/man9/nv.9 head/sys/contrib/libnv/nvlist.c Modified: head/share/man/man9/nv.9 == --- head/share/man/man9/nv.9Tue Aug 11 17:24:34 2015(r286641) +++ head/share/man/man9/nv.9Tue Aug 11 17:41:32 2015(r286642) @@ -28,7 +28,7 @@ .\ .\ $FreeBSD$ .\ -.Dd July 4, 2015 +.Dd Aug 11, 2015 .Dt NV 9 .Os .Sh NAME @@ -410,6 +410,16 @@ The argument can be NULL. Elements may not be removed from the nvlist while traversing it. The nvlist must not be in error state. +Note that +.Fn nvlist_next +will handle +.Va cookiep +being set to +.Dv NULL . +In this case first element is returned or +.Dv NULL +if nvlist is empty. +This behavior simplifies removing the first element from the list. .Pp The .Fn nvlist_exists Modified: head/sys/contrib/libnv/nvlist.c == --- head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:24:34 2015 (r286641) +++ head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:41:32 2015 (r286642) @@ -1026,9 +1026,8 @@ nvlist_next(const nvlist_t *nvl, int *ty nvpair_t *nvp; NVLIST_ASSERT(nvl); - PJDLOG_ASSERT(cookiep != NULL); - if (*cookiep == NULL) + if (cookiep == NULL || *cookiep == NULL) nvp = nvlist_first_nvpair(nvl); else nvp = nvlist_next_nvpair(nvl, *cookiep); @@ -1036,7 +1035,8 @@ nvlist_next(const nvlist_t *nvl, int *ty return (NULL); if (typep != NULL) *typep = nvpair_type(nvp); - *cookiep = nvp; + if (cookiep != NULL) + *cookiep = nvp; return (nvpair_name(nvp)); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286643 - head
Author: emaste Date: Tue Aug 11 17:48:58 2015 New Revision: 286643 URL: https://svnweb.freebsd.org/changeset/base/286643 Log: Fix comment describing legacy target and wrap to 80 columns Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Aug 11 17:41:32 2015(r286642) +++ head/Makefile.inc1 Tue Aug 11 17:48:58 2015(r286643) @@ -1225,9 +1225,10 @@ update: # # -# legacy: Build compatibility shims for the next three targets. This is a minimal -# set of tools and shims necessary to compensate for older systems which don't have -# the APIs that the targets built in bootstrap-tools, build-tools or cross-tools. +# legacy: Build compatibility shims for the next three targets. This is a +# minimal set of tools and shims necessary to compensate for older systems +# which don't have the APIs required by the targets built in bootstrap-tools, +# build-tools or cross-tools. # # ELF Tool Chain libraries are needed for ELF tools and dtrace tools. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286625 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
On 11.08.2015 18:47, Steven Hartland wrote: On 11/08/2015 11:51, Andriy Gapon wrote: On 11/08/2015 13:39, Alexander Motin wrote: Author: mav Date: Tue Aug 11 10:39:19 2015 New Revision: 286625 URL: https://svnweb.freebsd.org/changeset/base/286625 Log: MFV r277425: 5376 arc_kmem_reap_now() should not result in clearing arc_no_grow Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Steven Hartland kill...@multiplay.co.uk Reviewed by: Richard Elling richard.ell...@richardelling.com Approved by: Dan McDonald dan...@omniti.com Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Alexander, thank you very much for bringing all these upstream changes into our tree. It seems that some of the changes, though, non-trivially overlap with FreeBSD-specific changes to ZFS code. I think that this change is one of the examples. It would be good if a strategy of the resolution of each non-trivial conflict was described and possibly discussed. Reviewing the change without knowing the general idea behind it is not always easy. I actually eliminated most of the miss-matches between illumos and FreeBSD in this area pretty recently, so I'm not sure that there's actually many FreeBSD specific changes, hence conflicts. Given I worked in this area before I did also make a point of reviewing the upstream commit. That's not to say it wouldn't be good to review these sorts of changes especially given the potential impact, however we don't have a very good track record (myself included) in reviewing things so I'm concerned that would just become a real progress blocker. The fact that we had 6+ months of lag from upstream having several developers in the area tells me that we accumulated too much divergence, so that merging of already reviewed patches makes people worry about another review. I think we should just take big sledgehammer and break through this wall. For those who want to polish their reviewing skills, I'll soon prepare more interesting patch to look at -- merging the new implementation of improved ARC locking from Illumos. That seems to be one of the biggest divergence points. I've managed find a way to apply those patches almost clean, to hope that it will work when the build completes. :) -- Alexander Motin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286641 - head/sys/netpfil/pf
Author: oshogbo Date: Tue Aug 11 17:24:34 2015 New Revision: 286641 URL: https://svnweb.freebsd.org/changeset/base/286641 Log: Use correct src/dst ports when removing states. Submitted by: Milosz Kaniewski m.kaniew...@wheelsystems.com, UMEZAWA Takeshi umez...@iij.ad.jp (orginal) Reviewed by: glebius Approved by: pjd (mentor) Obtained from:OpenBSD MFC after:3 days Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c == --- head/sys/netpfil/pf/pf_ioctl.c Tue Aug 11 16:51:44 2015 (r286640) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Aug 11 17:24:34 2015 (r286641) @@ -1665,13 +1665,13 @@ relock_DIOCKILLSTATES: if (s-direction == PF_OUT) { srcaddr = sk-addr[1]; dstaddr = sk-addr[0]; - srcport = sk-port[0]; + srcport = sk-port[1]; dstport = sk-port[0]; } else { srcaddr = sk-addr[0]; dstaddr = sk-addr[1]; srcport = sk-port[0]; - dstport = sk-port[0]; + dstport = sk-port[1]; } if ((!psk-psk_af || sk-af == psk-psk_af) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286645 - head/sys/contrib/libnv
Author: oshogbo Date: Tue Aug 11 18:01:10 2015 New Revision: 286645 URL: https://svnweb.freebsd.org/changeset/base/286645 Log: The nvlist_move_nvpair() function can fail in two cases, if: - the nvlist error is set, or - the nvlist case ignore flag is not set and there is attend to add element with duplicated name. In both cases the nvlist_move_nvpair() function free nvpair structure. If library will try to unpack a binary blob which contains duplicated names it will end up with using memory after free. To prevent that, the nvlist_move_nvpair() function interface is changed to report about failure and checks are added to the nvpair_xunpack() function. Discovered thanks to the american fuzzy lop. Approved by: pjd (mentor) Modified: head/sys/contrib/libnv/nv_impl.h head/sys/contrib/libnv/nvlist.c Modified: head/sys/contrib/libnv/nv_impl.h == --- head/sys/contrib/libnv/nv_impl.hTue Aug 11 17:54:51 2015 (r286644) +++ head/sys/contrib/libnv/nv_impl.hTue Aug 11 18:01:10 2015 (r286645) @@ -93,7 +93,7 @@ nvpair_t *nvlist_prev_nvpair(const nvlis void nvlist_add_nvpair(nvlist_t *nvl, const nvpair_t *nvp); -void nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp); +bool nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp); void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent); Modified: head/sys/contrib/libnv/nvlist.c == --- head/sys/contrib/libnv/nvlist.c Tue Aug 11 17:54:51 2015 (r286644) +++ head/sys/contrib/libnv/nvlist.c Tue Aug 11 18:01:10 2015 (r286645) @@ -330,7 +330,7 @@ nvlist_clone(const nvlist_t *nvl) newnvp = nvpair_clone(nvp); if (newnvp == NULL) break; - nvlist_move_nvpair(newnvl, newnvp); + (void)nvlist_move_nvpair(newnvl, newnvp); } if (nvp != NULL) { nvlist_destroy(newnvl); @@ -848,7 +848,8 @@ nvlist_xunpack(const void *buf, size_t s } if (ptr == NULL) goto failed; - nvlist_move_nvpair(nvl, nvp); + if (!nvlist_move_nvpair(nvl, nvp)) + goto failed; if (tmpnvl != NULL) { nvl = tmpnvl; tmpnvl = NULL; @@ -1124,7 +1125,7 @@ nvlist_add_stringv(nvlist_t *nvl, const nvl-nvl_error = ERRNO_OR_DEFAULT(ENOMEM); ERRNO_SET(nvl-nvl_error); } else { - nvlist_move_nvpair(nvl, nvp); + (void)nvlist_move_nvpair(nvl, nvp); } } @@ -1143,7 +1144,7 @@ nvlist_add_null(nvlist_t *nvl, const cha nvl-nvl_error = ERRNO_OR_DEFAULT(ENOMEM); ERRNO_SET(nvl-nvl_error); } else { - nvlist_move_nvpair(nvl, nvp); + (void)nvlist_move_nvpair(nvl, nvp); } } @@ -1163,7 +1164,7 @@ nvlist_add_binary(nvlist_t *nvl, const c nvl-nvl_error = ERRNO_OR_DEFAULT(ENOMEM); ERRNO_SET(nvl-nvl_error); } else { - nvlist_move_nvpair(nvl, nvp); + (void)nvlist_move_nvpair(nvl, nvp); } } @@ -1184,7 +1185,7 @@ nvlist_add_##type(nvlist_t *nvl, const c nvl-nvl_error = ERRNO_OR_DEFAULT(ENOMEM); \ ERRNO_SET(nvl-nvl_error); \ } else {\ - nvlist_move_nvpair(nvl, nvp); \ + (void)nvlist_move_nvpair(nvl, nvp); \ } \ } @@ -1198,7 +1199,7 @@ NVLIST_ADD(int, descriptor); #undef NVLIST_ADD -void +bool nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp) { @@ -1208,18 +1209,19 @@ nvlist_move_nvpair(nvlist_t *nvl, nvpair if (nvlist_error(nvl) != 0) { nvpair_free(nvp); ERRNO_SET(nvlist_error(nvl)); - return; + return (false); } if ((nvl-nvl_flags NV_FLAG_NO_UNIQUE) == 0) { if (nvlist_exists(nvl, nvpair_name(nvp))) { nvpair_free(nvp); nvl-nvl_error = EEXIST; ERRNO_SET(nvl-nvl_error); - return; + return (false); } } nvpair_insert(nvl-nvl_head, nvp, nvl); + return (true); } void @@ -1238,7 +1240,7 @@ nvlist_move_string(nvlist_t *nvl, const nvl-nvl_error = ERRNO_OR_DEFAULT(ENOMEM); ERRNO_SET(nvl-nvl_error); } else { - nvlist_move_nvpair(nvl, nvp); + (void)nvlist_move_nvpair(nvl, nvp); } } @@ -1259,7
svn commit: r286646 - head/sys/contrib/libnv
Author: oshogbo Date: Tue Aug 11 18:17:31 2015 New Revision: 286646 URL: https://svnweb.freebsd.org/changeset/base/286646 Log: If any function fail (the ptr variable will be equal to NULL), we shouldn't return buffer. Instead we should free it and return NULL. Approved by: pjd (mentor) Modified: head/sys/contrib/libnv/nvlist.c Modified: head/sys/contrib/libnv/nvlist.c == --- head/sys/contrib/libnv/nvlist.c Tue Aug 11 18:01:10 2015 (r286645) +++ head/sys/contrib/libnv/nvlist.c Tue Aug 11 18:17:31 2015 (r286646) @@ -629,10 +629,8 @@ nvlist_xpack(const nvlist_t *nvl, int64_ nvpair_init_datasize(nvp); ptr = nvpair_pack_header(nvp, ptr, left); - if (ptr == NULL) { - nv_free(buf); - return (NULL); - } + if (ptr == NULL) + goto fail; switch (nvpair_type(nvp)) { case NV_TYPE_NULL: ptr = nvpair_pack_null(nvp, ptr, left); @@ -650,7 +648,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_ tmpnvl = nvpair_get_nvlist(nvp); ptr = nvlist_pack_header(tmpnvl, ptr, left); if (ptr == NULL) - goto out; + goto fail; tmpnvp = nvlist_first_nvpair(tmpnvl); if (tmpnvp != NULL) { nvl = tmpnvl; @@ -670,10 +668,8 @@ nvlist_xpack(const nvlist_t *nvl, int64_ default: PJDLOG_ABORT(Invalid type (%d)., nvpair_type(nvp)); } - if (ptr == NULL) { - nv_free(buf); - return (NULL); - } + if (ptr == NULL) + goto fail; while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { cookie = NULL; nvl = nvlist_get_parent(nvl, cookie); @@ -682,7 +678,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_ nvp = cookie; ptr = nvpair_pack_nvlist_up(ptr, left); if (ptr == NULL) - goto out; + goto fail; } } @@ -690,6 +686,9 @@ out: if (sizep != NULL) *sizep = size; return (buf); +fail: + nv_free(buf); + return (NULL); } void * ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286647 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Tue Aug 11 19:15:55 2015 New Revision: 286647 URL: https://svnweb.freebsd.org/changeset/base/286647 Log: Fix assertion panic caused by combination of r286598 and TRIM. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 18:17:31 2015(r286646) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 11 19:15:55 2015(r286647) @@ -2326,8 +2326,10 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) * want to re-destroy the header's L2 portion. */ if (HDR_HAS_L2HDR(hdr)) { - trim_map_free(dev-l2ad_vdev, hdr-b_l2hdr.b_daddr, - hdr-b_l2hdr.b_asize, 0); + if (hdr-b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) + trim_map_free(dev-l2ad_vdev, + hdr-b_l2hdr.b_daddr, + hdr-b_l2hdr.b_asize, 0); arc_hdr_l2hdr_destroy(hdr); } @@ -4412,8 +4414,10 @@ arc_release(arc_buf_t *buf, void *tag) * to acquire the l2ad_mtx. */ if (HDR_HAS_L2HDR(hdr)) { - trim_map_free(hdr-b_l2hdr.b_dev-l2ad_vdev, - hdr-b_l2hdr.b_daddr, hdr-b_l2hdr.b_asize, 0); + if (hdr-b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) + trim_map_free(hdr-b_l2hdr.b_dev-l2ad_vdev, + hdr-b_l2hdr.b_daddr, + hdr-b_l2hdr.b_asize, 0); arc_hdr_l2hdr_destroy(hdr); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286648 - head/sys/arm/ti/am335x
Author: ian Date: Tue Aug 11 19:25:26 2015 New Revision: 286648 URL: https://svnweb.freebsd.org/changeset/base/286648 Log: Make this compile again when PPS_SYNC is defined. Also remove a couple comment blocks and constants that no longer apply. Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c == --- head/sys/arm/ti/am335x/am335x_dmtimer.c Tue Aug 11 19:15:55 2015 (r286647) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Tue Aug 11 19:25:26 2015 (r286648) @@ -101,15 +101,6 @@ __FBSDID($FreeBSD$); #define DMT_TSICR_RESET (1 1) /* TSICR perform soft reset */ #defineDMT_TCAR2 0x48/* Capture Reg */ -/* - * Use timer 2 for the eventtimer. When PPS support is not compiled in, there's - * no need to use a timer that has an associated capture-input pin, so use timer - * 3 for timecounter. When PPS is compiled in we ignore the default and use - * whichever of timers 4-7 have the capture pin configured. - */ -#defineDEFAULT_ET_TIMER2 -#defineDEFAULT_TC_TIMER3 - #defineDMTIMER_READ4(sc, reg) (bus_read_4((sc)-tmr_mem_res, (reg))) #defineDMTIMER_WRITE4(sc, reg, val)(bus_write_4((sc)-tmr_mem_res, (reg), (val))) @@ -383,10 +374,10 @@ am335x_dmtimer_pps_init(device_t dev, st TASK_INIT(sc-pps_task, 0, am335x_dmtimer_process_pps_event, sc); /* Create the PPS cdev. */ + unit = device_get_unit(dev); sc-pps_cdev = make_dev(am335x_dmtimer_pps_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, PPS_CDEV_NAME); sc-pps_cdev-si_drv1 = sc; - unit = device_get_unit(sc-pps_cdev); device_printf(dev, Using DMTimer%d for PPS device /dev/%s%d\n, am335x_dmtimer_pps_module, PPS_CDEV_NAME, unit); @@ -597,12 +588,6 @@ am335x_dmtimer_attach(device_t dev) clk_ident_t timer_id; int enable; - /* -* Note that if this routine returns an error status rather than running -* to completion it makes no attempt to clean up allocated resources; -* the system is essentially dead anyway without functional timers. -*/ - sc = device_get_softc(dev); sc-dev = dev; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale
Author: jilles Date: Tue Aug 11 21:59:36 2015 New Revision: 286649 URL: https://svnweb.freebsd.org/changeset/base/286649 Log: Fix and re-enable UTF-8 tests. Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c head/lib/libc/tests/locale/Makefile Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c == --- head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Tue Aug 11 19:25:26 2015(r286648) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c Tue Aug 11 21:59:36 2015(r286649) @@ -88,13 +88,11 @@ static struct test { }, { en_US.UTF-8, [\001\177][\302\200\337\277][\340\240\200\357\277\277][\360\220\200 - \200\367\277\277\277][\370\210\200\200\200\373\277\277\277\277][\374 - \204\200\200\200\200\375\277\277\277\277\277], + \200\364\217\277\277], { 0x5b, 0x01, 0x7f, 0x5d, 0x5b, 0x80, 0x7ff, 0x5d, 0x5b, 0x800, 0x, - 0x5d, 0x5b, 0x1, 0x1f, 0x5d, 0x5b, 0x20, 0x3ff, 0x5d, - 0x5b, 0x400, 0x7fff, 0x5d }, - { 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1, 1, 5, 5, 1, 1, 6, 6, 1 }, - 24 + 0x5d, 0x5b, 0x1, 0x10, 0x5d }, + { 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1 }, + 16 }, { ja_JP.ISO2022-JP2, \033$BF|K\1348l\033(BA\033$B$\\033(BB\033$B$$\033(B, Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c == --- head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Tue Aug 11 19:25:26 2015(r286648) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c Tue Aug 11 21:59:36 2015(r286649) @@ -82,12 +82,10 @@ static struct test { { en_US.UTF-8, [\001\177][\302\200\337\277][\340\240\200\357\277\277][\360\220\200 - \200\367\277\277\277][\370\210\200\200\200\373\277\277\277\277][\374 - \204\200\200\200\200\375\277\277\277\277\277], + \200\364\217\277\277], { 0x5B, 0x01, 0x7F, 0x5D, 0x5B, 0x80, 0x07FF, 0x5D, 0x5B, 0x0800, - 0x, 0x5D, 0x5B, 0x1, 0x1F, 0x5D, 0x5B, 0x20, - 0x3FF, 0x5D, 0x5B, 0x400, 0x7FFF, 0x5D, 0x0A + 0x, 0x5D, 0x5B, 0x1, 0x10, 0x5D, 0x0A }, {1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1 Modified: head/lib/libc/tests/locale/Makefile == --- head/lib/libc/tests/locale/Makefile Tue Aug 11 19:25:26 2015 (r286648) +++ head/lib/libc/tests/locale/Makefile Tue Aug 11 21:59:36 2015 (r286649) @@ -6,7 +6,7 @@ TESTSDIR= ${TESTSBASE}/lib/libc/locale NETBSD_ATF_TESTS_C=io_test NETBSD_ATF_TESTS_C+= mbrtowc_test -#NETBSD_ATF_TESTS_C+= mbstowcs_test +NETBSD_ATF_TESTS_C+= mbstowcs_test NETBSD_ATF_TESTS_C+= mbsnrtowcs_test NETBSD_ATF_TESTS_C+= mbtowc_test NETBSD_ATF_TESTS_C+= wcscspn_test ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286651 - head/lib/libc/string
Author: araujo Date: Wed Aug 12 00:49:20 2015 New Revision: 286651 URL: https://svnweb.freebsd.org/changeset/base/286651 Log: Describe that bcopy(3) is deprecated and marked as LEGACY in POSIX.1-2001 and removed from the specification in POSIX.1-2008. New softwares shall use memcpy(3) or memmove(3). Differential Revision:D3358 Reviewed by: wblock Approved by: rodrigc Sponsored by: gandi.net Modified: head/lib/libc/string/bcopy.3 Modified: head/lib/libc/string/bcopy.3 == --- head/lib/libc/string/bcopy.3Tue Aug 11 22:43:28 2015 (r286650) +++ head/lib/libc/string/bcopy.3Wed Aug 12 00:49:20 2015 (r286651) @@ -31,7 +31,7 @@ .\ @(#)bcopy.38.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd June 4, 1993 +.Dd August 11, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -57,6 +57,20 @@ The two strings may overlap. If .Fa len is zero, no bytes are copied. +.Pp +This function is deprecated (marked as LEGACY in +POSIX.1-2001): use +.Xr memcpy 3 +or +.Xr memmove 3 +in new programs. +Note that the first two arguments are +interchanged for +.Xr memcpy 3 +and +.Xr memmove 3 . +POSIX.1-2008 removes the specification of +.Fn bcopy . .Sh SEE ALSO .Xr memccpy 3 , .Xr memcpy 3 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286652 - head/tools/build/mk
Author: jmmv Date: Wed Aug 12 03:03:51 2015 New Revision: 286652 URL: https://svnweb.freebsd.org/changeset/base/286652 Log: Mark usr/include/c++/v1/tr1 as obsolete The directory usr/include/c++/v1 was marked as obsolete but its tr1 subdir was not, resulting in a removal error in delete-old. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 12 00:49:20 2015(r286651) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 12 03:03:51 2015(r286652) @@ -4017,6 +4017,7 @@ OLD_FILES+=usr/lib32/libcxxrt.a OLD_FILES+=usr/lib32/libcxxrt.so OLD_LIBS+=usr/lib32/libcxxrt.so.1 OLD_FILES+=usr/lib32/libcxxrt_p.a +OLD_DIRS+=usr/include/c++/v1/tr1 OLD_DIRS+=usr/include/c++/v1/experimental OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286651 - head/lib/libc/string
2015-08-12 8:49 GMT+08:00 Marcelo Araujo ara...@freebsd.org: Author: araujo Date: Wed Aug 12 00:49:20 2015 New Revision: 286651 URL: https://svnweb.freebsd.org/changeset/base/286651 Log: Describe that bcopy(3) is deprecated and marked as LEGACY in POSIX.1-2001 and removed from the specification in POSIX.1-2008. New softwares shall use memcpy(3) or memmove(3). Differential Revision:D3358 Reviewed by: wblock Approved by: rodrigc Sponsored by: gandi.net Forgot to add: Approved by: rodrigc (mentor) Best Regards, -- -- Marcelo Araujo(__)ara...@freebsd.org \\\'',)http://www.FreeBSD.org http://www.freebsd.org/ \/ \ ^ Power To Server. .\. /_) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r286653 - head/sys/dev/uart
Author: marcel Date: Wed Aug 12 04:03:04 2015 New Revision: 286653 URL: https://svnweb.freebsd.org/changeset/base/286653 Log: Use bus_alloc_resource_any(), rather than bus_alloc_resource() with start 0 and end ~0. This avoids confusion WRT to what the value of length can or should be. Modified: head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_core.c == --- head/sys/dev/uart/uart_core.c Wed Aug 12 03:03:51 2015 (r286652) +++ head/sys/dev/uart/uart_core.c Wed Aug 12 04:03:04 2015 (r286653) @@ -474,14 +474,13 @@ uart_bus_probe(device_t dev, int regshft */ sc-sc_rrid = rid; sc-sc_rtype = SYS_RES_IOPORT; - sc-sc_rres = bus_alloc_resource(dev, sc-sc_rtype, sc-sc_rrid, - 0, ~0, uart_getrange(sc-sc_class), RF_ACTIVE); + sc-sc_rres = bus_alloc_resource_any(dev, sc-sc_rtype, sc-sc_rrid, + RF_ACTIVE); if (sc-sc_rres == NULL) { sc-sc_rrid = rid; sc-sc_rtype = SYS_RES_MEMORY; - sc-sc_rres = bus_alloc_resource(dev, sc-sc_rtype, - sc-sc_rrid, 0, ~0, uart_getrange(sc-sc_class), - RF_ACTIVE); + sc-sc_rres = bus_alloc_resource_any(dev, sc-sc_rtype, + sc-sc_rrid, RF_ACTIVE); if (sc-sc_rres == NULL) return (ENXIO); } @@ -556,8 +555,8 @@ uart_bus_attach(device_t dev) * Re-allocate. We expect that the softc contains the information * collected by uart_bus_probe() intact. */ - sc-sc_rres = bus_alloc_resource(dev, sc-sc_rtype, sc-sc_rrid, - 0, ~0, uart_getrange(sc-sc_class), RF_ACTIVE); + sc-sc_rres = bus_alloc_resource_any(dev, sc-sc_rtype, sc-sc_rrid, + RF_ACTIVE); if (sc-sc_rres == NULL) { mtx_destroy(sc-sc_hwmtx_s); return (ENXIO); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale
On Tue, Aug 11, 2015 at 2:59 PM, Jilles Tjoelker jil...@freebsd.org wrote: Author: jilles Date: Tue Aug 11 21:59:36 2015 New Revision: 286649 URL: https://svnweb.freebsd.org/changeset/base/286649 Log: Fix and re-enable UTF-8 tests. Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c head/lib/libc/tests/locale/Makefile Thanks for fixing this. What is the procedure that FreeBSD developers need to follow to push this kind of change upstream to NetBSD? -- Craig ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286651 - head/lib/libc/string
On Wed, 12 Aug 2015, Marcelo Araujo wrote: Log: Describe that bcopy(3) is deprecated and marked as LEGACY in POSIX.1-2001 and removed from the specification in POSIX.1-2008. Only new and old POSIX software and all Standard C software. Standard C never had bcopy(). POSIX didn't have it until API bloat restored many old mistakes. But BSD has it. It is memmove(9undoc) that is deprecated (but brought back by KPI bloat) in the kernel in FreeBSD, but this is about userland. Only portability requires preferring mememove(3). New softwares shall use memcpy(3) or memmove(3). Bad advice. bcopy() is only similar to memmove(). Modified: head/lib/libc/string/bcopy.3 Modified: head/lib/libc/string/bcopy.3 == --- head/lib/libc/string/bcopy.3Tue Aug 11 22:43:28 2015 (r286650) +++ head/lib/libc/string/bcopy.3Wed Aug 12 00:49:20 2015 (r286651) @@ -31,7 +31,7 @@ .\ @(#)bcopy.38.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd June 4, 1993 +.Dd August 11, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -57,6 +57,20 @@ The two strings may overlap. The strings must not overlap for memcpy(). If .Fa len is zero, no bytes are copied. +.Pp +This function is deprecated (marked as LEGACY in +POSIX.1-2001): use +.Xr memcpy 3 +or +.Xr memmove 3 +in new programs. Bad advice, since these functions are not similar, and it doesn't follow from deprecation all the versions of POSIX that have it that it is deprecated in FreeBSD. It follows from the nonexistence of the function in POSIX before 2001 and after 2008 that the function is more than deprecated. +Note that the first two arguments are +interchanged for +.Xr memcpy 3 +and +.Xr memmove 3 . The first 2 args are not interchanged for memcpy() and memmove(). They are only interchanged for bcopy() and memmove(). +POSIX.1-2008 removes the specification of +.Fn bcopy . .Sh SEE ALSO .Xr memccpy 3 , .Xr memcpy 3 , Removing all mention of memcpy() (except the one in the Xr) would fix half of the bugs. POSIX has much better wording for this, as for most things. From a 2001 draft: X 5112 APPLICATION USAGE X 5113memmove( ) is preferred over this function. When bcopy() was only deprecated, it was un-preferred but not banned. X 5114The following are approximately equivalent (note the order of the arguments): X 5115bcopy(s1,s2,n) = memmove(s2,s1,n) X 5116For maximum portability, it is recommended to replace the function call to bcopy( ) as follows: X 5117#define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0) No mention of memcpy(), but an example of how to translate with so much attention to details that it is hard to read. It even translates the return type. X X 5118 RATIONALE X 5119None. X X 5120 FUTURE DIRECTIONS X 5121This function may be withdrawn in a future version. It was apparently withdrawn in 2008. X X 5122 SEE ALSO X 5123memmove( ), the Base Definitions volume of IEEE Std 1003.1-200x, strings.h No mention of memcpy() here either. I don't like long lists of Xr's to vaguely related man pages, with no hint of the exact relation, in FreeBSD man pages. A reader wishing to know any relation at all would have to read all the man pages in the long list to see some relation, and understand all their details to see the exact relation. X X 5124 CHANGE HISTORY X 5125First released in Issue 4, Version 2. X X 5126 Issue 5 X 5127Moved from X/OPEN UNIX extension to BASE. X X 5128 Issue 6 X 5129This function is marked LEGACY. So bcopy() was apparently XSI in Issue 4, BASE in Issue 5, and BASE plus LEGACY in Issue 6. So why is it still XSI in 2001? I don't know the dates of the Issues. Oops, this is because only the strings.h include with the prototype for bcopy() is XSI in 2001. It doesn't exist in POSIX.1-1996. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r286651 - head/lib/libc/string
Hello bde@ Maybe change it as it is in NetBSD would be better: http://netbsd.gw.com/cgi-bin/man-cgi?bcopy+3+NetBSD-current They still mention about memcpy(3). However, I need to check their implementation. What do you think? 2015-08-12 11:51 GMT+08:00 Bruce Evans b...@optusnet.com.au: On Wed, 12 Aug 2015, Marcelo Araujo wrote: Log: Describe that bcopy(3) is deprecated and marked as LEGACY in POSIX.1-2001 and removed from the specification in POSIX.1-2008. Only new and old POSIX software and all Standard C software. Standard C never had bcopy(). POSIX didn't have it until API bloat restored many old mistakes. But BSD has it. It is memmove(9undoc) that is deprecated (but brought back by KPI bloat) in the kernel in FreeBSD, but this is about userland. Only portability requires preferring mememove(3). New softwares shall use memcpy(3) or memmove(3). Bad advice. bcopy() is only similar to memmove(). Modified: head/lib/libc/string/bcopy.3 Modified: head/lib/libc/string/bcopy.3 == --- head/lib/libc/string/bcopy.3Tue Aug 11 22:43:28 2015 (r286650) +++ head/lib/libc/string/bcopy.3Wed Aug 12 00:49:20 2015 (r286651) @@ -31,7 +31,7 @@ .\ @(#)bcopy.3 8.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd June 4, 1993 +.Dd August 11, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -57,6 +57,20 @@ The two strings may overlap. The strings must not overlap for memcpy(). If .Fa len is zero, no bytes are copied. +.Pp +This function is deprecated (marked as LEGACY in +POSIX.1-2001): use +.Xr memcpy 3 +or +.Xr memmove 3 +in new programs. Bad advice, since these functions are not similar, and it doesn't follow from deprecation all the versions of POSIX that have it that it is deprecated in FreeBSD. It follows from the nonexistence of the function in POSIX before 2001 and after 2008 that the function is more than deprecated. +Note that the first two arguments are +interchanged for +.Xr memcpy 3 +and +.Xr memmove 3 . The first 2 args are not interchanged for memcpy() and memmove(). They are only interchanged for bcopy() and memmove(). +POSIX.1-2008 removes the specification of +.Fn bcopy . .Sh SEE ALSO .Xr memccpy 3 , .Xr memcpy 3 , Removing all mention of memcpy() (except the one in the Xr) would fix half of the bugs. POSIX has much better wording for this, as for most things. From a 2001 draft: X 5112 APPLICATION USAGE X 5113memmove( ) is preferred over this function. When bcopy() was only deprecated, it was un-preferred but not banned. X 5114The following are approximately equivalent (note the order of the arguments): X 5115bcopy(s1,s2,n) = memmove(s2,s1,n) X 5116For maximum portability, it is recommended to replace the function call to bcopy( ) as follows: X 5117#define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0) No mention of memcpy(), but an example of how to translate with so much attention to details that it is hard to read. It even translates the return type. X X 5118 RATIONALE X 5119None. X X 5120 FUTURE DIRECTIONS X 5121This function may be withdrawn in a future version. It was apparently withdrawn in 2008. X X 5122 SEE ALSO X 5123memmove( ), the Base Definitions volume of IEEE Std 1003.1-200x, strings.h No mention of memcpy() here either. I don't like long lists of Xr's to vaguely related man pages, with no hint of the exact relation, in FreeBSD man pages. A reader wishing to know any relation at all would have to read all the man pages in the long list to see some relation, and understand all their details to see the exact relation. X X 5124 CHANGE HISTORY X 5125First released in Issue 4, Version 2. X X 5126 Issue 5 X 5127Moved from X/OPEN UNIX extension to BASE. X X 5128 Issue 6 X 5129This function is marked LEGACY. So bcopy() was apparently XSI in Issue 4, BASE in Issue 5, and BASE plus LEGACY in Issue 6. So why is it still XSI in 2001? I don't know the dates of the Issues. Oops, this is because only the strings.h include with the prototype for bcopy() is XSI in 2001. It doesn't exist in POSIX.1-1996. Bruce -- -- Marcelo Araujo(__)ara...@freebsd.org \\\'',)http://www.FreeBSD.org http://www.freebsd.org/ \/ \ ^ Power To Server. .\. /_) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org