summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Rework the read/write support in the bios disk driver some to cut downjhb2007-10-241-196/+112
| | | | | | | | | | | | | | | | | | | on duplicated code and support 64-bit LBAs for GPT. - The code to manage an EDD or C/H/S I/O request are now in their own routines. The EDD routine now handles a full 64-bit LBA instead of truncating LBAs to the lower 32-bits. (MBRs and BSD labels only have 32-bit LBAs anyway, so the only LBAs ever passed down were 32-bit). - All of the bounce buffer and retry logic duplicated in bd_read() and bd_write() are merged into a single bd_io() routine that takes an extra direction argument. bd_read() and bd_write() are now simple wrappers around bd_io(). - If a disk supports EDD then always use it rather than only using it if the cylinder is > 1023. Other parts of the boot code already do something similar to this. Also, GPT just uses LBAs, so for a GPT disk it's probably best to ignore C/H/S completely. Always using EDD when it is supported by a disk is an easy way to accomplish this. MFC after: 1 week
* MFi386: revision 1.50nyan2007-10-241-39/+30
| | | | Reindent the read/write code of bd_realstrategy() so it is more readable.
* MFi386: revision 1.41nyan2007-10-241-2/+1
| | | | | | | Slightly cleanup the 'bootdev' concept on x86 by changing the various macros to treat the 'slice' field as a real part of the bootdev instead of as hack that spans two other fields (adaptor (sic) and controller) that are not used in any modern FreeBSD boot code.
* Reindent the read/write code of bd_realstrategy() so it is more readable.jhb2007-10-241-39/+30
| | | | MFC after: 1 week
* Slightly cleanup the 'bootdev' concept on x86 by changing the variousjhb2007-10-249-29/+16
| | | | | | | | macros to treat the 'slice' field as a real part of the bootdev instead of as hack that spans two other fields (adaptor (sic) and controller) that are not used in any modern FreeBSD boot code. MFC after: 1 week
* Fix reading of files that use pax 'size' attribute to store size.kientzle2007-10-241-7/+21
| | | | | | | In particular, bsdtar uses the pax 'size' attribute for any file over 8G. MFC after: 3 days
* Stop disabling USB in the PAE kernel config. The USB code has beenjhb2007-10-241-21/+0
| | | | | | | using bus_dma(9) for quite a while now and has been used on 64-bit archs as well. MFC after: 1 month
* When processing multi-path ip6 routers, place each router entry on itscsjp2007-10-241-0/+2
| | | | | | | | | | own line. We made this change in traceroute(8) some time ago. This is particularly useful when you are not resolving hostnames since ip6 addresses can be quite long, and lines wrap fairly easily in the multi-path router case. Discussed with: bz MFC after: 1 month
* Move where we audit the PID argument such that we unconditionallycsjp2007-10-241-1/+1
| | | | | | | | | audit it at the beginning of the syscall. This fixes a problem where the user supplies an invalid process ID which is > 0 which results in the PID argument not being audited. Obtained from: TrustedBSD Project MFC after: 1 week
* Use extended process token. The in kernel process auditcsjp2007-10-241-2/+2
| | | | | | | | | | state is stored in an extended subject token now. Make sure that we are using the extended data. This fixes the termID for process tokens. Obtained from: TrustedBSD Project Discussed with: rwatson MFC after: 1 week
* Take out the single-threading code in fork.julian2007-10-231-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After discussions with jeff, alc, (various Ironport people), david Xu, and mostly Alfred (who found the problem) it has been demonstrated that this is not needed for our implementations of threads and represents a real (as in we've seen it happen a lot) deadlock danger. Several points: Since forking multiple threads is not allowed, and posix states that any mutexes owned by othre threads wilol be owned in the child by phantom threads, and therads shouldn't ba accessing shared structures without protection, It can be proved that if this leads to the child process accessing inconsistent data, it's a programming error. The mode of thread_single() being used in fork() is the wrong one. It is using SINGLE_NO_EXIT when it should be using SINGLE_BOUNDARY. Even if this we used, System processes have no need to do it as they have no userland to get inconsistent. This commmit first fixes the above bugs to get tehm correct in CVS. then removes them with #ifdef. This is so that history contains the corrected version should it be needed in the future. This code may be needed if we implement the forkall() syscall from Solaris. It may be needed for other non-posix thread libraries at some time in the future, so let the code sit for a short while while I do some work on it anyhow. This removes a reproducible lockup in NFS. It may be argued that maybe doing a fork while holding a vnode lock may not be the best idea in th efirst place but it shouldn't cause a deadlock. The removal has been running under soak test for several days now. This removal should be seriously considered for 7.0 and RELENG_6. Note. There is code in the core-dumping code that may have a similar problem with coredumping threaded processes MFC After: 4 days
* Back out 2nd part of wrong iswascii() change in prev. commit.ache2007-10-231-1/+1
|
* Bump MAC_VERSION to 4 and add an 8.x line in the version table. Version 4rwatson2007-10-231-1/+2
| | | | | | | will include significant synchronization to the Mac OS X Leopard version of the MAC Framework. Obtained from: TrustedBSD Project
* Forced commit to note that rev.1.179 has the following fixes in addition tobde2007-10-230-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the ones mentioned in its log message: For mount-update from rw to ro: - don't misuse the MNT_FORCE flag to break error handling for mark volume to clean. - mark volume back to dirty if g_access() failed (not just if mark volume to clean failed). - clear pm_fmod on success. pm_fmod is bogus, since it is only used to cause a panic in unreachable code when we forgot to clear it here, but something like it will be needed. For mount-update from rw to ro and from ro to rw: - don't forget to lock mp when changing mp->mnt_flag. Giant locking may make this unnecessary, but it is simpler to copy what ffs does. Most of the style changes are near here, to copy ffs's cleaner code. For unmount: - don't misuse the MNT_FORCE flag to break error handling for mark volume to clean. Failure of markvoldirty() is similar to failure of ffs_subupdate() in ffs, and ffs has never used MNT_FORCE to ignore the corresponding error. MNT_FORCE for unmount _should_ force the unmount to succeed, but forcing away of write errors has never been supported. - explicitly return 0 instead of `error' in msdosfs_unmount() after committing to success. This is now just a style fix. With errors from markvoldirty() ignored in the MNT_FORCE case, any error in markvoldirty() caused a nonzero `error' to be returned despite committing to success. Upper layers soon paniced trying to back out of the committed unmount. This bug used to be present in another form in most file systems. VOP_CLOSE() was called after committing to success, so it was necessary to force the VOP_CLOSE() to succeed. This was not done; instead, VOP_CLOSE()'s error code was returned to upper layers so upper layers soon paniced if VOP_CLOSE() failed. I saw this panic only with a buggy device driver with a missing close method, but VOP_CLOSE() can easily fail in theory, with errors like EDQUOT and EIO for unwriteable output. Now the bug has moved. g_vfs_close() is called instead of VOP_CLOSE(), and it returns void so unmount vops cannot even detect errors in it. Hopefully, errors in it only occur when there are other bugs. E.g., with the MNT_FORCE bug in msdosfs_close(), when markvoldirty() in umount failed due to the bugs in mount-update, and when this was the only write error, g_vfs_close() was reached despite the write error being detected earlier; it found one unwriteable buffer which it can only report via printf; then after fixing the panic, umount(2) "succeeded" but the unwriteable buffer was left in the buffer cache and/or VMIO object to spam the console with printfs about failed write attempts, until the next rw mount when the write succeeds, possibly clobbering different media.
* Avoid leaking file descriptorsmatteo2007-10-231-3/+7
|
* - Use pci_enable_busmaster() to turn on busmaster.kevlo2007-10-231-35/+10
| | | | | | | - Don't test memory/port status and emit an error message; the PCI bus will do this. Reviewed by: sam
* Cut over to ULE on PowerPCgrehan2007-10-237-8/+17
| | | | | | | | | | | | | | | | | kern/sched_ule.c - Add __powerpc__ to the list of supported architectures powerpc/conf/GENERIC - Swap SCHED_4BSD with SCHED_ULE powerpc/powerpc/genassym.c - Export TD_LOCK field of thread struct powerpc/powerpc/swtch.S - Handle new 3rd parameter to cpu_switch() by updating the old thread's lock. Note: uniprocessor-only, will require modification for MP support. powerpc/powerpc/vm_machdep.c - Set 3rd param of cpu_switch to mutex of old thread's lock, making the call a no-op. Reviewed by: marcel, jeffr (slightly older version)
* Add a BUGS section to note that mount/chroot changes sincejb2007-10-221-0/+4
| | | | | | | | | a module was loaded might make the pathname inaccurate. I wonder if an inode reference should be stored with the pathname to allow a validity check? Suggested by: rwatson@
* Close a race when trying to lookup a gateway route in rt_check().jhb2007-10-222-2/+6
| | | | | | | | | | | | | | | | | | | | | Specifically, if two threads were doing concurrent lookups and the existing gateway was marked down, the the first thread would drop a reference on the gateway route and then unlock the "root" route while it tried to allocate a new route. The second thread could then also drop a reference on the same gateway route resulting in a reference underflow. Fix this by clearing the gateway route pointer after dropping the reference count but before dropping the lock. Secondly, in this same case, the second thread would overwrite the gateway route pointer w/o free'ing a reference to the route installed by the first thread. In practice this would probably just fix a lost reference that would result in a route never being freed. This fixes panics observed in rt_check() and rtexpunge(). MFC after: 1 week PR: kern/112490 Insight from: mehuljv at yahoo.com Reviewed by: ru (found the "not-setting it to NULL" part) Tested by: several
* Forced commit to clarify that previous change was:delphij2007-10-220-0/+0
| | | | Submitted by: bde
* Fixes to msdosfs dirtyflag related stuff:delphij2007-10-221-26/+42
| | | | | | | | | | | - markvoldirty() needs to write to underlying GEOM provider. We have to do that *before* g_access() which sets the GEOM provider to read-only. - Remove dirty flag before free'ing iconv related resources. The dirty flag removal could fail, and it is hard to revert the iconv-free after the fail. - Mark volume as dirty if we have failed to mark it clean for safe. - Other style fixes to the touched functions.
* Remove the libmytinfow library that's available only in RELENG_6.ru2007-10-221-1/+7
|
* - Stop calling libthr alternative as it's now the defaultru2007-10-221-15/+7
| | | | | | | | | | | | | | threading library. - Now that libpthread is a symlink, it's no longer possible to link applications with libpthread and have libmap.conf(5) select the desired threading library; applications will be linked to the default threading library, libkse or libthr. Remove an obsolete paragraph. - Mention that improvements can be seen compared to libkse. Reviewed by: deischen, davidxu
* Hide the implementation details about multiple threading librariesru2007-10-2260-71/+11
| | | | | | from the synopses of pthread*(3) manpages. Reviewed by: deischen, davidxu
* Remove an obsolete paragraph that pthread_single_np(3) isru2007-10-221-7/+0
| | | | | | not implemented in libthr. Reviewed by: deischen, davidxu
* Added ".Lb libkse" support to mdoc(7).ru2007-10-221-0/+1
| | | | Reviewed by: deischen, davidxu
* 1. Determine the location of the rndc* binaries relative to $commanddougb2007-10-221-14/+22
| | | | | | | | | | | | | | | | | | | | so that when using named from the ports (or elsewhere) the proper rndc* commands will be run. 2. Rework the stop routine using ideas from brooks and delphij. Specifically I am duplicating a lot of code from rc.subr's stop routine so that this one will behave more like the one in rc.subr, but use rndc to kill the daemon (or regular kill if that fails). This also avoids the problems related to using killall if rndc fails, which is bad if you're running more than one named on the same box. 3. Take a concept from gshapiro and allow the rndc.key file to be owned by root OR the named_uid user. Although I used different solutions, this commit handles issues raised in: PR: conf/73929 PR: conf/103976 PR: conf/109409
* Add one of HTC Smartphone/PocketPC device IDs.mav2007-10-222-0/+5
| | | | Tested with Qtek S200 (HTC Prophet).
* Correct an error of omission in the reimplementation of the pagealc2007-10-221-0/+4
| | | | | | | | | | cache: vnode_pager_setsize() must handle the case where a file is truncated to a non-page-size-aligned boundary and there is a cached page underlying the new end of file. Reported by: kris, tegge Tested by: kris MFC after: 3 days
* Correct an error in vm_map_sync(), nee vm_map_clean(), that has existedalc2007-10-221-2/+4
| | | | | | | | | | | | since revision 1.1. Specifically, neither traversal of the vm map checks whether the end of the vm map has been reached. Consequently, the first traversal can wrap around and bogusly return an error. This error has gone unnoticed for so long because no one had ever before tried msync(2)ing a region above the stack. Reported by: peter MFC after: 1 week
* Add the full module path name to the kld_file_stat structurejb2007-10-224-9/+71
| | | | | | | | | | | | | | for kldstat(2). This allows libdtrace to determine the exact file from which a kernel module was loaded without having to guess. The kldstat(2) API is versioned with the size of the kld_file_stat structure, so this change creates version 2. Add the pathname to the verbose output of kldstat(8) too. MFC: 3 days
* Consistently use the word 'flag' to refer to ELF_F_* constants.jkoshy2007-10-225-19/+19
| | | | MFC after: 1 day
* Add PRIV_VFS_STAT privilege, which will allow overriding policy limits onrwatson2007-10-212-0/+2
| | | | | | | the right to stat() a file, such as in mac_bsdextended. Obtained from: TrustedBSD Project MFC after: 3 months
* Add the freebsd-zfs alias. Both APM and GPT have ZFS partitionmarcel2007-10-214-0/+17
| | | | types.
* Fix a last-minute, but more importantly, an untested change thatmarcel2007-10-211-1/+1
| | | | | made the previous commit non-functional: the usage string was put in the wrong field...
* Add a partition type for ZFS.marcel2007-10-211-0/+1
|
* - Given that we tell the compiler that struct ip is packed and 32-bitmarius2007-10-211-4/+4
| | | | | | | | | | | | | | | | | aligned, GCC 4.2.1 also generates code for sendudp() that assumes this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing the loader to crash due to an unaligned access of wbuf in sendudp() when netbooting sparc64. Solve this by specifying wbuf as packed and 32-bit aligned, too. As for lastdata and readudp() this currently is no issue when compiled with GCC 4.2.1, though give lastdata the same treatment as wbuf for consistency and possibility of being affected in the future. [1] - Sprinkle const on a lookup table. Reported by: marcel [1] Submitted by: yongari [1] Reviewed by: marcel [1] MFC after: 5 days
* Add a UUID for ZFS file systems.marcel2007-10-211-0/+2
| | | | UUID reused from: Craig Boston
* Additions from libpcap 0.9.8 unbreak the build.mlaier2007-10-211-0/+134
| | | | | Pointy hat to: mlaier X-MFC after: RELENG_7 buildworld
* Canonicalize naming of local variables for struct ksem and associatedrwatson2007-10-217-72/+71
| | | | | | | labels to 'ks' and 'kslabel' to reflect the convention in posix_sem.c. MFC after: 3 days Obtained from: TrustedBSD Project
* Fix a couple of small typos, and remove a duplicatedougb2007-10-213-16/+2
|
* Remove references to the 'e_phnum' field of the ELF header. Instead,jkoshy2007-10-212-14/+9
| | | | | | point the reader to the elf_getphnum() function. MFC after: 1 day
* Change to the original version of the poem titled "The Guy in the Glass,"dougb2007-10-211-18/+22
| | | | | and add the proper attribution. Also add an explanation for the Middle English word used in the first line.
* Refer the reader to the elf_update(3) manual page for more informationjkoshy2007-10-211-2/+5
| | | | | | on application control of ELF object layout. MFC after: 1 day
* This time to the right branchjulian2007-10-211-0/+8
| | | | note the renaming of the kthread_xxx calls
* fix up some code for older systems changed by accident in the last commitjulian2007-10-212-2/+12
| | | | | this whole support for systems earlier than 5.0 should probably be removed but I'll at least FIX it before removing it, so that CVS has it right.
* Mark the point where kthread_xxx disappeared and kproc_xxx appearedjulian2007-10-211-1/+1
|
* Remove out of date commentsjulian2007-10-211-3/+3
|
* Note the temporary removal of these functions.julian2007-10-211-0/+7
|
* This was kthread.9julian2007-10-211-0/+302
| | | | | | | it has been duplicated to kproc.9 kthread.9 will continue on to describe the coming kthread_xxx functions which will actually make threads.
OpenPOWER on IntegriCloud