svn commit: r225329 - head/lib/libarchive
Author: mm Date: Fri Sep 2 13:03:56 2011 New Revision: 225329 URL: http://svn.freebsd.org/changeset/base/225329 Log: Import additional bugfix for reading and extracting makefs-created ISO images with tar. Vendor revision 3648 (merge of 3647): Additional fix to issue 168 because the change of r3642 was not sufficient. - Make sure "CL" entry appear after its "RE" entry which the "CL" entry should be connected with. - Give consideration to the case that the top level "RE" entry has already been exposed outside before its tree. Approved by: re (kib) Obtained from:libarchive (release/2.8, svn rev 3648) MFC after:3 days Modified: head/lib/libarchive/archive_read_support_format_iso9660.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c == --- head/lib/libarchive/archive_read_support_format_iso9660.c Fri Sep 2 09:55:35 2011(r225328) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Fri Sep 2 13:03:56 2011(r225329) @@ -1815,8 +1815,11 @@ parse_file_info(struct archive_read *a, file->re_descendant = 1; if (file->cl_offset != 0) { parent->subdirs++; - /* To be appeared before other dirs. */ - file->offset = file->number = file->cl_offset; + /* Overwrite an offset and a number of this "CL" entry +* to appear before other dirs. "+1" to those is to +* make sure to appear after "RE" entry which this +* "CL" entry should be connected with. */ + file->offset = file->number = file->cl_offset + 1; } } @@ -2581,13 +2584,16 @@ next_cache_entry(struct archive_read *a, continue; } else if (file->re_descendant) { /* -* Do not expose this at this time -* because we have not gotten its full-path -* name yet. +* If the top level "RE" entry of this entry +* is not exposed, we, accordingly, should not +* expose this entry at this time because +* we cannot make its proper full-path name. */ - if (rede_add_entry(file) < 0) - goto fatal_rr; - continue; + if (rede_add_entry(file) == 0) + continue; + /* Otherwise we can expose this entry because +* it seems its top level "RE" has already been +* exposed. */ } } break; ___ 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: r225330 - head/lib/libmemstat
Author: pluknet Date: Fri Sep 2 14:10:42 2011 New Revision: 225330 URL: http://svn.freebsd.org/changeset/base/225330 Log: Cosmetic cleanup: remove #define LIBMEMSTAT used to prevent a nested include of opt_vmpage.h from vm/vm_page.h. opt_vmpage.h was retired before 7.0 together with options PQ_NOOPT. Approved by: re (kib) MFC after:3 days Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c == --- head/lib/libmemstat/memstat_uma.c Fri Sep 2 13:03:56 2011 (r225329) +++ head/lib/libmemstat/memstat_uma.c Fri Sep 2 14:10:42 2011 (r225330) @@ -30,7 +30,6 @@ #include #include -#defineLIBMEMSTAT /* Cause vm_page.h not to include opt_vmpage.h */ #include #include ___ 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: r225331 - head/usr.sbin/mfiutil
Author: jhb Date: Fri Sep 2 16:00:51 2011 New Revision: 225331 URL: http://svn.freebsd.org/changeset/base/225331 Log: Move the logic to parse volume cache commands out into a separate function and use a loop so that multiple cache commands can be strung together on the command line into a single update to the volume's properties. Reviewed by: bz Approved by: re (kib) MFC after:1 week Modified: head/usr.sbin/mfiutil/mfi_volume.c head/usr.sbin/mfiutil/mfiutil.8 Modified: head/usr.sbin/mfiutil/mfi_volume.c == --- head/usr.sbin/mfiutil/mfi_volume.c Fri Sep 2 14:10:42 2011 (r225330) +++ head/usr.sbin/mfiutil/mfi_volume.c Fri Sep 2 16:00:51 2011 (r225331) @@ -111,16 +111,16 @@ mfi_ld_set_props(int fd, struct mfi_ld_p } static int -update_cache_policy(int fd, struct mfi_ld_props *props, uint8_t new_policy, -uint8_t mask) +update_cache_policy(int fd, struct mfi_ld_props *old, struct mfi_ld_props *new) { int error; uint8_t changes, policy; - policy = (props->default_cache_policy & ~mask) | new_policy; - if (policy == props->default_cache_policy) + if (old->default_cache_policy == new->default_cache_policy && + old->disk_cache_policy == new->disk_cache_policy) return (0); - changes = policy ^ props->default_cache_policy; + policy = new->default_cache_policy; + changes = policy ^ old->default_cache_policy; if (changes & MR_LD_CACHE_ALLOW_WRITE_CACHE) printf("%s caching of I/O writes\n", policy & MR_LD_CACHE_ALLOW_WRITE_CACHE ? "Enabling" : @@ -142,9 +142,21 @@ update_cache_policy(int fd, struct mfi_l printf("%s write caching with bad BBU\n", policy & MR_LD_CACHE_WRITE_CACHE_BAD_BBU ? "Enabling" : "Disabling"); + if (old->disk_cache_policy != new->disk_cache_policy) { + switch (new->disk_cache_policy) { + case MR_PD_CACHE_ENABLE: + printf("Enabling write-cache on physical drives\n"); + break; + case MR_PD_CACHE_DISABLE: + printf("Disabling write-cache on physical drives\n"); + break; + case MR_PD_CACHE_UNCHANGED: + printf("Using default write-cache setting on physical drives\n"); + break; + } + } - props->default_cache_policy = policy; - if (mfi_ld_set_props(fd, props) < 0) { + if (mfi_ld_set_props(fd, new) < 0) { error = errno; warn("Failed to set volume properties"); return (error); @@ -152,12 +164,130 @@ update_cache_policy(int fd, struct mfi_l return (0); } +static void +stage_cache_setting(struct mfi_ld_props *props, uint8_t new_policy, +uint8_t mask) +{ + + props->default_cache_policy &= ~mask; + props->default_cache_policy |= new_policy; +} + +/* + * Parse a single cache directive modifying the passed in policy. + * Returns -1 on a parse error and the number of arguments consumed + * on success. + */ +static int +process_cache_command(int ac, char **av, struct mfi_ld_props *props) +{ + uint8_t policy; + + /* I/O cache settings. */ + if (strcmp(av[0], "all") == 0 || strcmp(av[0], "enable") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "none") == 0 || strcmp(av[0], "disable") == 0) { + stage_cache_setting(props, 0, MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "reads") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_READ_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "writes") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_WRITE_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + + /* Write cache behavior. */ + if (strcmp(av[0], "write-back") == 0) { + stage_cache_setting(props, MR_LD_CACHE_WRITE_BACK, + MR_LD_CACHE_WRITE_BACK); + return (1); + } + if (strcmp(av[0], "write-through") == 0) { + stage_cache_setting(props, 0, MR_LD_CACHE_WRITE_BACK); + return (1); + } + if (strcmp(av[0], "bad-bbu-write-cache") == 0) { + if (ac < 2) { +
svn commit: r225334 - in head/tools/tools/netrate: netblast netsend
Author: marius Date: Fri Sep 2 16:40:18 2011 New Revision: 225334 URL: http://svn.freebsd.org/changeset/base/225334 Log: Fix alignment assumptions. PR: 160289 Approved by: re (kib) MFC after:3 days Modified: head/tools/tools/netrate/netblast/netblast.c head/tools/tools/netrate/netsend/netsend.c Modified: head/tools/tools/netrate/netblast/netblast.c == --- head/tools/tools/netrate/netblast/netblast.cFri Sep 2 16:18:06 2011(r225333) +++ head/tools/tools/netrate/netblast/netblast.cFri Sep 2 16:40:18 2011(r225334) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -108,11 +109,9 @@ blast_loop(int s, long duration, u_char * previous send, the error will turn up the current send * operation, causing the current sequence number also to be * skipped. -* -* XXXRW: Note alignment assumption. */ if (packet_len >= 4) { - *((u_int32_t *)packet) = htonl(counter); + be32enc(packet, counter); counter++; } if (send(s, packet, packet_len, 0) < 0) Modified: head/tools/tools/netrate/netsend/netsend.c == --- head/tools/tools/netrate/netsend/netsend.c Fri Sep 2 16:18:06 2011 (r225333) +++ head/tools/tools/netrate/netsend/netsend.c Fri Sep 2 16:40:18 2011 (r225334) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -203,11 +204,9 @@ timing_loop(struct _a *a) * skipped. * The counter is incremented only on the initial port number, * so all destinations will see the same set of packets. -* -* XXXRW: Note alignment assumption. */ if (cur_port == a->port && a->packet_len >= 4) { - *((u_int32_t *)a->packet) = htonl(counter); + be32enc(a->packet, counter); counter++; } if (a->port == a->port_max) { /* socket already bound */ ___ 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: r225338 - head/sbin/fsck_ffs
Author: delphij Date: Fri Sep 2 17:05:34 2011 New Revision: 225338 URL: http://svn.freebsd.org/changeset/base/225338 Log: Fix the check in dircheck() on namlen. The value of namlen is copied from on-disk d_namlen, which is a 8-bit unsigned integer which can never exceed MAXNAMLEN (255) so the test is always true. Moreover, UFS does not allow d_namelen being zero. Change namlen from u_int to u_int8_t, and replace the unneeded test with a useful test. PR: bin/160339 Submitted by: Eugene Grosbein MFC after:2 weeks Approved by: re (kib) Modified: head/sbin/fsck_ffs/dir.c Modified: head/sbin/fsck_ffs/dir.c == --- head/sbin/fsck_ffs/dir.cFri Sep 2 17:05:11 2011(r225337) +++ head/sbin/fsck_ffs/dir.cFri Sep 2 17:05:34 2011(r225338) @@ -210,7 +210,7 @@ dircheck(struct inodesc *idesc, struct d size_t size; char *cp; u_char type; - u_int namlen; + u_int8_t namlen; int spaceleft; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); @@ -225,7 +225,7 @@ dircheck(struct inodesc *idesc, struct d type = dp->d_type; if (dp->d_reclen < size || idesc->id_filesize < size || - namlen > MAXNAMLEN || + namlen == 0 || type > 15) goto bad; for (cp = dp->d_name, size = 0; size < namlen; size++) ___ 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: r225339 - head/sys/dev/coretemp
Author: delphij Date: Fri Sep 2 17:06:23 2011 New Revision: 225339 URL: http://svn.freebsd.org/changeset/base/225339 Log: Expose more variables from coretemp(4) via sysctl: - tjmax - Tj(max) value from the CPU - delta - current delta reading - resolution - sensor resolution in Celsius - throttle_log - whether a #PROCHOT was asserted since last reset Submitted by: Mark Johnston (mostly) MFC after:1 month Approved by: re (kib) Modified: head/sys/dev/coretemp/coretemp.c Modified: head/sys/dev/coretemp/coretemp.c == --- head/sys/dev/coretemp/coretemp.cFri Sep 2 17:05:34 2011 (r225338) +++ head/sys/dev/coretemp/coretemp.cFri Sep 2 17:06:23 2011 (r225339) @@ -48,12 +48,21 @@ __FBSDID("$FreeBSD$"); #include #include -#defineTZ_ZEROC2732 +#defineTZ_ZEROC2732 + +#defineTHERM_STATUS_LOG0x02 +#defineTHERM_STATUS0x01 +#defineTHERM_STATUS_TEMP_SHIFT 16 +#defineTHERM_STATUS_TEMP_MASK 0x7f +#defineTHERM_STATUS_RES_SHIFT 27 +#defineTHERM_STATUS_RES_MASK 0x0f +#defineTHERM_STATUS_VALID_SHIFT31 +#defineTHERM_STATUS_VALID_MASK 0x01 struct coretemp_softc { device_tsc_dev; int sc_tjmax; - struct sysctl_oid *sc_oid; + unsigned intsc_throttle_log; }; /* @@ -64,8 +73,10 @@ static int coretemp_probe(device_t dev); static int coretemp_attach(device_t dev); static int coretemp_detach(device_t dev); -static int coretemp_get_temp(device_t dev); -static int coretemp_get_temp_sysctl(SYSCTL_HANDLER_ARGS); +static uint64_tcoretemp_get_thermal_msr(int cpu); +static voidcoretemp_clear_thermal_msr(int cpu); +static int coretemp_get_val_sysctl(SYSCTL_HANDLER_ARGS); +static int coretemp_throttle_log_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t coretemp_methods[] = { /* Device interface */ @@ -83,8 +94,16 @@ static driver_t coretemp_driver = { sizeof(struct coretemp_softc), }; +enum therm_info { + CORETEMP_TEMP, + CORETEMP_DELTA, + CORETEMP_RESOLUTION, + CORETEMP_TJMAX, +}; + static devclass_t coretemp_devclass; -DRIVER_MODULE(coretemp, cpu, coretemp_driver, coretemp_devclass, NULL, NULL); +DRIVER_MODULE(coretemp, cpu, coretemp_driver, coretemp_devclass, NULL, +NULL); static void coretemp_identify(driver_t *driver, device_t parent) @@ -135,6 +154,8 @@ coretemp_attach(device_t dev) uint64_t msr; int cpu_model, cpu_stepping; int ret, tjtarget; + struct sysctl_oid *oid; + struct sysctl_ctx_list *ctx; sc->sc_dev = dev; pdev = device_get_parent(dev); @@ -149,7 +170,7 @@ coretemp_attach(device_t dev) */ if (cpu_model < 0xe) return (ENXIO); - + #if 0 /* * XXXrpaulo: I have this CPU model and when it returns from C3 * coretemp continues to function properly. @@ -216,7 +237,7 @@ coretemp_attach(device_t dev) ret = rdmsr_safe(MSR_IA32_TEMPERATURE_TARGET, &msr); if (ret == 0) { tjtarget = (msr >> 16) & 0xff; - + /* * On earlier generation of processors, the value * obtained from IA32_TEMPERATURE_TARGET register is @@ -243,15 +264,35 @@ coretemp_attach(device_t dev) if (bootverbose) device_printf(dev, "Setting TjMax=%d\n", sc->sc_tjmax); + ctx = device_get_sysctl_ctx(dev); + + oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), OID_AUTO, + "coretemp", CTLFLAG_RD, NULL, "Per-CPU thermal information"); + /* -* Add the "temperature" MIB to dev.cpu.N. +* Add the MIBs to dev.cpu.N and dev.cpu.N.coretemp. */ - sc->sc_oid = SYSCTL_ADD_PROC(device_get_sysctl_ctx(pdev), - SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), - OID_AUTO, "temperature", - CTLTYPE_INT | CTLFLAG_RD, - dev, 0, coretemp_get_temp_sysctl, "IK", + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, dev, + CORETEMP_TEMP, coretemp_get_val_sysctl, "IK", "Current temperature"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "delta", + CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_DELTA, + coretemp_get_val_sysctl, "I", + "Delta between TCC activation and current temperature"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "resolution", + CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_RESOLUTION, + coretemp_get_val_sy
svn commit: r225340 - head/sys/dev/ichwd
Author: delphij Date: Fri Sep 2 17:06:50 2011 New Revision: 225340 URL: http://svn.freebsd.org/changeset/base/225340 Log: Fix a bug in ichwd(4) which prevents it from beig enabled if the new timeout is the same timeout. Submitted by: Dmitrij Tejblum PR: kern/139604 MFC after:2 weeks Approved by: re (kib) Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c == --- head/sys/dev/ichwd/ichwd.c Fri Sep 2 17:06:23 2011(r225339) +++ head/sys/dev/ichwd/ichwd.c Fri Sep 2 17:06:50 2011(r225340) @@ -402,11 +402,10 @@ ichwd_event(void *arg, unsigned int cmd, cmd &= WD_INTERVAL; timeout = ((uint64_t)1 << cmd) / ICHWD_TICK; if (cmd) { - if (timeout != sc->timeout) { - if (!sc->active) - ichwd_tmr_enable(sc); + if (!sc->active) + ichwd_tmr_enable(sc); + if (timeout != sc->timeout) ichwd_tmr_set(sc, timeout); - } ichwd_tmr_reload(sc); *error = 0; } else { ___ 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: r225341 - head/sbin/mount
Author: jhb Date: Fri Sep 2 17:11:59 2011 New Revision: 225341 URL: http://svn.freebsd.org/changeset/base/225341 Log: Clear the mountprog variable after each mountfs() call so that mountprog options don't leak over into subsequent mounts listed in /etc/fstab. While here, fix a memory leak in debug mode. Reported by: rank1seeker @ gmail Approved by: re (kib) MFC after:1 week Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c == --- head/sbin/mount/mount.c Fri Sep 2 17:06:50 2011(r225340) +++ head/sbin/mount/mount.c Fri Sep 2 17:11:59 2011(r225341) @@ -589,6 +589,9 @@ mountfs(const char *vfstype, const char for (i = 1; i < mnt_argv.c; i++) (void)printf(" %s", mnt_argv.a[i]); (void)printf("\n"); + free(optbuf); + free(mountprog); + mountprog = NULL; return (0); } @@ -599,6 +602,8 @@ mountfs(const char *vfstype, const char } free(optbuf); + free(mountprog); + mountprog = NULL; if (verbose) { if (statfs(name, &sf) < 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"
svn commit: r225343 - head/sys/dev/xen/console
Author: rwatson Date: Fri Sep 2 17:36:01 2011 New Revision: 225343 URL: http://svn.freebsd.org/changeset/base/225343 Log: Add support for alternative break-to-debugger support on the Xen console. This should help debug boot-time hangs experienced in 9.0-BETA. MFC after:3 weeks Tested by:sbruno Approved by: re (kib) Modified: head/sys/dev/xen/console/console.c Modified: head/sys/dev/xen/console/console.c == --- head/sys/dev/xen/console/console.c Fri Sep 2 17:30:50 2011 (r225342) +++ head/sys/dev/xen/console/console.c Fri Sep 2 17:36:01 2011 (r225343) @@ -70,6 +70,10 @@ static int rc, rp; static unsigned int cnsl_evt_reg; static unsigned int wc, wp; /* write_cons, write_prod */ +#ifdef KDB +static int xc_altbrk; +#endif + #define CDEV_MAJOR 12 #defineXCUNIT(x) (dev2unit(x)) #define ISTTYOPEN(tp) ((tp) && ((tp)->t_state & TS_ISOPEN)) @@ -268,8 +272,12 @@ xencons_rx(char *buf, unsigned len) #endif ) { tty_lock(tp); - for (i = 0; i < len; i++) + for (i = 0; i < len; i++) { +#ifdef KDB + kdb_alt_break(buf[i], &xc_altbrk); +#endif ttydisc_rint(tp, buf[i], 0); + } ttydisc_rint_done(tp); tty_unlock(tp); } else { ___ 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: r225344 - in head/sys: kern security/mac security/mac_biba security/mac_mls security/mac_stub security/mac_test
Author: rwatson Date: Fri Sep 2 17:40:39 2011 New Revision: 225344 URL: http://svn.freebsd.org/changeset/base/225344 Log: Correct several issues in the integration of POSIX shared memory objects and the new setmode and setowner fileops in FreeBSD 9.0: - Add new MAC Framework entry point mac_posixshm_check_create() to allow MAC policies to authorise shared memory use. Provide a stub policy and test policy templates. - Add missing Biba and MLS implementations of mac_posixshm_check_setmode() and mac_posixshm_check_setowner(). - Add 'accmode' argument to mac_posixshm_check_open() -- unlike the mac_posixsem_check_open() entry point it was modeled on, the access mode is required as shared memory access can be read-only as well as writable; this isn't true of POSIX semaphores. - Implement full range of POSIX shared memory entry points for Biba and MLS. Sponsored by: Google Inc. Obtained from:TrustedBSD Project Approved by:re (kib) Modified: head/sys/kern/uipc_shm.c head/sys/security/mac/mac_framework.h head/sys/security/mac/mac_policy.h head/sys/security/mac/mac_posix_shm.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c Modified: head/sys/kern/uipc_shm.c == --- head/sys/kern/uipc_shm.cFri Sep 2 17:36:01 2011(r225343) +++ head/sys/kern/uipc_shm.cFri Sep 2 17:40:39 2011(r225344) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Robert N. M. Watson + * Copyright (c) 2006, 2011 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,25 +31,21 @@ * * TODO: * - * (2) Need to export data to a userland tool via a sysctl. Should ipcs(1) + * (1) Need to export data to a userland tool via a sysctl. Should ipcs(1) * and ipcrm(1) be expanded or should new tools to manage both POSIX * kernel semaphores and POSIX shared memory be written? * - * (3) Add support for this file type to fstat(1). + * (2) Add support for this file type to fstat(1). * - * (4) Resource limits? Does this need its own resource limits or are the + * (3) Resource limits? Does this need its own resource limits or are the * existing limits in mmap(2) sufficient? * - * (5) Partial page truncation. vnode_pager_setsize() will zero any parts + * (4) Partial page truncation. vnode_pager_setsize() will zero any parts * of a partially mapped page as a result of ftruncate(2)/truncate(2). * We can do the same (with the same pmap evil), but do we need to * worry about the bits on disk if the page is swapped out or will the * swapper zero the parts of a page that are invalid if the page is * swapped back in for us? - * - * (6) Add MAC support in mac_biba(4) and mac_mls(4). - * - * (7) Add a MAC check_create() hook for creating new named objects. */ #include @@ -551,8 +547,16 @@ shm_open(struct thread *td, struct shm_o if (shmfd == NULL) { /* Object does not yet exist, create it if requested. */ if (uap->flags & O_CREAT) { - shmfd = shm_alloc(td->td_ucred, cmode); - shm_insert(path, fnv, shmfd); +#ifdef MAC + error = mac_posixshm_check_create(td->td_ucred, + path); + if (error == 0) { +#endif + shmfd = shm_alloc(td->td_ucred, cmode); + shm_insert(path, fnv, shmfd); +#ifdef MAC + } +#endif } else { free(path, M_SHMFD); error = ENOENT; @@ -569,7 +573,7 @@ shm_open(struct thread *td, struct shm_o else { #ifdef MAC error = mac_posixshm_check_open(td->td_ucred, - shmfd); + shmfd, FFLAGS(uap->flags & O_ACCMODE)); if (error == 0) #endif error = shm_access(shmfd, td->td_ucred, Modified: head/sys/security/mac/mac_framework.h == --- head/sys/security/mac/mac_framework.h Fri Sep 2 17:36:01 2011 (r225343) +++ head/sys/security/mac/mac_framework.h Fri Sep 2 17:40:39 2011 (r225344) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007-2011 Robert N. M. Watson * Copyright (c) 2001-2005 Networks Associates Technology, Inc. * Copyright (c) 2005-2006 SPARTA, Inc. * All rights reserved. @@ -238,9 +238,1
svn commit: r225346 - head/share/man/man3
Author: rse Date: Fri Sep 2 18:13:46 2011 New Revision: 225346 URL: http://svn.freebsd.org/changeset/base/225346 Log: Fix a little typo and get rid of a cryptic description by aligning the text to the remaining description. Approved by: re Modified: head/share/man/man3/queue.3 Modified: head/share/man/man3/queue.3 == --- head/share/man/man3/queue.3 Fri Sep 2 18:04:26 2011(r225345) +++ head/share/man/man3/queue.3 Fri Sep 2 18:13:46 2011(r225346) @@ -193,7 +193,7 @@ O(1) removal of an entry from the head o .It Forward traversal through the list. .It -Swawpping the contents of two lists. +Swapping the contents of two lists. .El .Pp Singly-linked lists are the simplest of the four data structures @@ -227,7 +227,7 @@ Code size is about 15% greater and opera than singly-linked lists. .El .Pp -Singly-linked tailqs are ideal for applications with large datasets and +Singly-linked tail queues are ideal for applications with large datasets and few or no removals, or for implementing a FIFO queue. .Pp ___ 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: r225348 - head/share/man/man4
Author: brueffer Date: Fri Sep 2 18:37:48 2011 New Revision: 225348 URL: http://svn.freebsd.org/changeset/base/225348 Log: Remove an incorrect apostrophe. PR: 160267 Submitted by: Warren Block Approved by: re (kib) MFC after:1 week Modified: head/share/man/man4/wlan.4 Modified: head/share/man/man4/wlan.4 == --- head/share/man/man4/wlan.4 Fri Sep 2 18:18:24 2011(r225347) +++ head/share/man/man4/wlan.4 Fri Sep 2 18:37:48 2011(r225348) @@ -121,7 +121,7 @@ Note that an interface's type cannot be .Pp .Nm defines several mechanisms by which plugin modules may -be used to extend its' functionality. +be used to extend its functionality. Cryptographic support such as WEP, TKIP, and AES-CCMP are implemented as standalone modules (if not statically configured into a system) that register with ___ 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: r225350 - in head/sys: dev/usb dev/usb/quirk dev/usb/storage sys
Author: hselasky Date: Fri Sep 2 18:50:44 2011 New Revision: 225350 URL: http://svn.freebsd.org/changeset/base/225350 Log: This patch adds automatic detection of USB mass storage devices which does not support the no synchronize cache SCSI command. The __FreeBSD_version version macro has been bumped and external kernel modules needs to be recompiled after this patch. Approved by:re (kib) MFC after: 1 week PR: usb/160299 Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_dynamic.h head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usbdi.h head/sys/sys/param.h Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 2 18:44:57 2011 (r225349) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 2 18:50:44 2011 (r225350) @@ -148,12 +148,10 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(AIPTEK, POCKETCAM3M, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), - USB_QUIRK(AIPTEK2, SUNPLUS_TECH, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, SDCR_6335, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, SDCR_6362, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(ALCOR, AU6390, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ALCOR, TRANSCEND, 0x, 0x, UQ_MSC_NO_GETMAXLUN, @@ -173,14 +171,12 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(CENTURY, EX35QUAT, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), - USB_QUIRK(CENTURY, EX35SW4_SB4, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(CYPRESS, XX6830XX, 0x, 0x, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), - USB_QUIRK(DMI, DISK, 0x000, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(EPSON, STYLUS_875DC, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(EPSON, STYLUS_895, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, @@ -188,7 +184,6 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(FEIYA, 5IN1, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(FREECOM, DVD, 0x, 0x, UQ_MSC_FORCE_PROTO_SCSI), - USB_QUIRK(FREECOM, HDD, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(FUJIPHOTO, MASS0100, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI_I, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(GENESYS, GL641USB2IDE, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, @@ -232,7 +227,6 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(IOMEGA, ZIP100, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */ - USB_QUIRK(JMICRON, JM20336, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(JMICRON, JM20337, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), @@ -279,8 +273,6 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_ATAPI), USB_QUIRK(MYSON, HEDEN, 0x, 0x, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(MYSON, HEDEN_8813, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(MYSON, STARREADER, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(NEODIO, ND3260, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ), USB_QUIRK(NETAC, CF_CARD, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, @@ -317,7 +309,6 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(PANASONIC, KXLCB35AN, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(PANASONIC, LS120CAM, 0x, 0x, UQ_MSC_FORCE_PROTO_UFI), - USB_QUIRK(PHILIPS, SPE3030CC, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(PLEXTOR, 40_12_40U, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), USB_QUIRK(PNY, ATTACHE2, 0x, 0x, UQ_M
svn commit: r225352 - head/share/man/man4
Author: brueffer Date: Fri Sep 2 18:52:28 2011 New Revision: 225352 URL: http://svn.freebsd.org/changeset/base/225352 Log: Wording, grammar and markup cleanup. PR: 159948 Submitted by: Ben Kaduk Approved by: re (kib) Modified: head/share/man/man4/ata.4 Modified: head/share/man/man4/ata.4 == --- head/share/man/man4/ata.4 Fri Sep 2 18:52:17 2011(r225351) +++ head/share/man/man4/ata.4 Fri Sep 2 18:52:28 2011(r225352) @@ -74,47 +74,56 @@ atasis_load="YES" atavia_load="YES" .Ed .Pp -First line is common hardware independent code. -Next three lines are generic bus-specific drivers. -ataahci is AHCI driver. -The rest are vendor-specific PCI drivers. -ATA_CAM option should always remain in kernel configuration to make -the driver work as CAM(4) subsystem module. +The first line is for the common hardware independent code, and is a +prerequisite for the other modules. +The next three lines are generic bus-specific drivers. +Of the rest, ataahci is the AHCI driver. +The others are vendor-specific PCI drivers. +The +.Dv ATA_CAM +option should always remain in the kernel configuration, to make +the driver work as a +.Xr CAM 4 +subsystem module. .Pp The following tunables are settable from the .Xr loader 8 : .Bl -ohang .It Va hw.ata.ata_dma_check_80pin -set to 0 to disable the 80pin cable check (default is 1, check the cable) +set to 0 to disable the 80pin cable check (the default is 1, check the cable) .It Va hint.atapci.X.msi -set to 1 to allow Message Signalled Interrupts (MSI) to be used by +set to 1 to allow Message Signalled Interrupts (MSI) to be used by the specified PCI ATA controller, if supported. .It Va hint.ata.X.devX.mode -limits initial ATA mode for specified device on specified channel. +limits the initial ATA mode for the specified device on specified the channel. .It Va hint.ata.X.mode -limits initial ATA mode for every device on specified channel. +limits the initial ATA mode for every device on the specified channel. .It Va hint.ata.X.pm_level -controls SATA interface Power Management for specified channel, -allowing to save some power by the cost of additional command latency. +controls SATA interface Power Management for the specified channel, +allowing some power savings at the cost of additional command latency. Possible values: .Bl -tag -compact .It 0 -interface Power Management is disabled, default value. +Interface Power Management is disabled. +This is the default value. .It 1 -device is allowed to initiate PM state change, host is passive. +The device is allowed to initiate a PM state change; the host is passive. .It 2 -host initiates PARTIAL PM state transition every time port becomes idle. +The host initiates a PARTIAL PM state transition every time a port becomes idle. .It 3 host initiates SLUMBER PM state transition every time port becomes idle. .El -Modes 2 and 3 are supported only for AHCI. +Modes 2 and 3 are only supported for AHCI. .El .Sh DESCRIPTION The .Nm -driver provides the CAM(4) subsystem access to ATA (IDE) and SATA ports +driver gives the +.Xr CAM 4 +subsystem access to the ATA (IDE) and SATA ports of many generic controllers. -Depending on controller, each PATA port or each one or two SATA ports are +Depending on the controller, each PATA (IDE) +port or each one or two SATA ports are represented to CAM as a separate bus with one or two targets. Most of the bus-management details are handled by the ATA/SATA-specific transport of CAM. @@ -126,22 +135,23 @@ ATAPI devices are handled by the SCSI pr .Xr sa 4 , etc. .Pp -Driver supports ATA and for the most of controllers ATAPI devices. +This driver supports ATA, and for the most of controllers, ATAPI devices. Command queuing and SATA port multipliers are not supported. -Device hot-plug and SATA interface power management supported only on +Device hot-plug and SATA interface power management is supported only on some controllers. .Pp The .Nm driver can change the transfer mode when the system is up and running. -See -.Xr camcontrol 8 -negotiate subcommand. +See the +.Cm negotiate +subcommand of +.Xr camcontrol 8 . .Pp The .Nm driver sets the maximum transfer mode supported by the hardware as default. -However the +However, the .Nm driver sometimes warns: .Dq Sy "DMA limited to UDMA33, non-ATA66 cable or device". @@ -247,10 +257,12 @@ The .Nm driver first appeared in .Fx 4.0 . -Turned into CAM(4) interface module in +It was turned into a +.Xr CAM 4 +interface module in .Fx 9.0 . .Sh AUTHORS .An Alexander Motin .Aq m...@freebsd.org , .An S\(/oren Schmidt -.Aq s...@freebsd.org . +.Aq s...@freebsd.org ___ 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: r225353 - head/sys/boot/forth
Author: jh Date: Fri Sep 2 19:29:37 2011 New Revision: 225353 URL: http://svn.freebsd.org/changeset/base/225353 Log: Restore behavior of the autoboot_delay="-1" boot menu setting to the pre-r222417 state. The behavior was essentially reversed in r222417 which can cause confusion. PR: 159775 Submitted by: Devin Teske Approved by: re (kib) Modified: head/sys/boot/forth/menu.4th head/sys/boot/forth/menu.4th.8 Modified: head/sys/boot/forth/menu.4th == --- head/sys/boot/forth/menu.4thFri Sep 2 18:52:28 2011 (r225352) +++ head/sys/boot/forth/menu.4thFri Sep 2 19:29:37 2011 (r225353) @@ -742,11 +742,12 @@ create init_text8 255 allot else -rot 2drop - \ disable timeout if less than zero + \ boot immediately if less than zero dup 0< if drop - 0 menu_timeout_enabled ! - 0 ( assigned to menu_timeout below ) + menu-create + 0 25 at-xy + 0 boot then then then Modified: head/sys/boot/forth/menu.4th.8 == --- head/sys/boot/forth/menu.4th.8 Fri Sep 2 18:52:28 2011 (r225352) +++ head/sys/boot/forth/menu.4th.8 Fri Sep 2 19:29:37 2011 (r225353) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2011 +.Dd Aug 29, 2011 .Dt MENU.4TH 8 .Os .Sh NAME @@ -96,11 +96,15 @@ will wait before executing by default) unless a key is pressed. If set to .Dq Li NO -(case-insensitive) or -.Dq Li -1 , +(case-insensitive) .Ic menu-display will wait for user input and never execute .Ic menu_timeout_command . +If set to +.Dq Li -1 , +.Ic menu-display +will boot immediately, preventing both interruption of the autoboot process and +escaping to the loader prompt. Default is .Dq Li 10 . See ___ 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: r225354 - head/sys/dev/smc
Author: stas Date: Fri Sep 2 20:35:22 2011 New Revision: 225354 URL: http://svn.freebsd.org/changeset/base/225354 Log: - Fix NULL pointer dereference when a packet of uneven size is being transmitted. Approved by: re (kib) MFC after:3 days Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c == --- head/sys/dev/smc/if_smc.c Fri Sep 2 19:29:37 2011(r225353) +++ head/sys/dev/smc/if_smc.c Fri Sep 2 20:35:22 2011(r225354) @@ -538,6 +538,7 @@ smc_task_tx(void *context, int pending) struct smc_softc*sc; struct mbuf *m, *m0; u_int packet, len; + int last_len; uint8_t *data; (void)pending; @@ -590,16 +591,18 @@ smc_task_tx(void *context, int pending) * Push the data out to the device. */ data = NULL; + last_len = 0; for (; m != NULL; m = m->m_next) { data = mtod(m, uint8_t *); smc_write_multi_2(sc, DATA0, (uint16_t *)data, m->m_len / 2); + last_len = m->m_len; } /* * Push out the control byte and and the odd byte if needed. */ if ((len & 1) != 0 && data != NULL) - smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[m->m_len - 1]); + smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[last_len - 1]); else smc_write_2(sc, DATA0, 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"
svn commit: r225356 - in head/sys: fs/nfsserver nfsserver
Author: rmacklem Date: Sat Sep 3 00:28:53 2011 New Revision: 225356 URL: http://svn.freebsd.org/changeset/base/225356 Log: Fix the NFS servers so that they can do a Lookup of "..", which requires that ni_strictrelative be set to 0, post-r224810. Tested by:swills (earlier version), geo dot liaskos at gmail.com Approved by: re (kib) Modified: head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/nfsserver/nfs_serv.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cFri Sep 2 23:51:55 2011 (r225355) +++ head/sys/fs/nfsserver/nfs_nfsdport.cSat Sep 3 00:28:53 2011 (r225356) @@ -282,6 +282,7 @@ nfsvno_namei(struct nfsrv_descript *nd, *retdirp = NULL; cnp->cn_nameptr = cnp->cn_pnbuf; + ndp->ni_strictrelative = 0; /* * Extract and set starting directory. */ Modified: head/sys/nfsserver/nfs_serv.c == --- head/sys/nfsserver/nfs_serv.c Fri Sep 2 23:51:55 2011 (r225355) +++ head/sys/nfsserver/nfs_serv.c Sat Sep 3 00:28:53 2011 (r225356) @@ -157,6 +157,7 @@ ndclear(struct nameidata *nd) nd->ni_vp = NULL; nd->ni_dvp = NULL; nd->ni_startdir = NULL; + nd->ni_strictrelative = 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"
svn commit: r225359 - head/sbin/fsck_ffs
Author: des Date: Sat Sep 3 03:12:33 2011 New Revision: 225359 URL: http://svn.freebsd.org/changeset/base/225359 Log: Forgot this nit in r221107. Approved by: re (kib) Modified: head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/main.c == --- head/sbin/fsck_ffs/main.c Sat Sep 3 01:45:37 2011(r225358) +++ head/sbin/fsck_ffs/main.c Sat Sep 3 03:12:33 2011(r225359) @@ -636,7 +636,7 @@ static void usage(void) { (void) fprintf(stderr, - "usage: %s [-BEFprfny] [-b block] [-c level] [-m mode] " + "usage: %s [-BEFfnpry] [-b block] [-c level] [-m mode] " "filesystem ...\n", getprogname()); exit(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"