gad [Mon, 20 Jun 2005 04:17:12 +0000 (04:17 +0000)]
Add a suite of regression tests for all the recent changes to `env',
using my own script to handle it. I wrote my own partially because
of all the quoting-issues involved with testing what I wanted to test,
and partially because this lets me commit one script and one data file,
instead of one-file-per-regression-test.
This suite was good enough for my initial testing (and it did help me
find a few bugs that would have otherwise been missed). I'm not sure
how well it will work in general use, but I figured I might as well
commit it. It won't *hurt* to have it available. At the worst, people
can just ignore it.
gad [Mon, 20 Jun 2005 03:43:25 +0000 (03:43 +0000)]
Add the '-S' and '-P' options. The '-S' option can be used to split
apart a string, and supports some text substitutions. This can be
used to provide all the flexibility (and more!) that was lost by recent
changes to how the kernel parses #!-lines in shell scripts.
The '-P' option provides a way to specify an alternate set of directories
to use when searching for the 'utility' program to run. This way you can
be sure what directories are used for that search, without changing the
value of PATH that the user has set. Note that on FreeBSD 6.0, this
option is worthless unless the '-S' option is also used.
gad [Mon, 20 Jun 2005 03:14:29 +0000 (03:14 +0000)]
If the `utility' specified starts with a '/' character, then execute it
without checking it for an equals-sign. If it starts with a slash, then
it cannot be a request to set the value of a valid environment variable.
gad [Mon, 20 Jun 2005 03:09:49 +0000 (03:09 +0000)]
Move the code that clears the environment when `-i' is specified, so it that
it does not happen until all single-letter options are processed. This will
be important for the -S option, which will be coming soon.
gad [Mon, 20 Jun 2005 03:06:54 +0000 (03:06 +0000)]
Add a '-v' option to `env', to make it easier to discover exactly what steps
it is doing, and what order it does them. This will be much more useful as
more options are added.
gad [Sun, 19 Jun 2005 02:21:03 +0000 (02:21 +0000)]
Fix a panic which could occur parsing #!-lines in a shell-script. If the
#!-line had multiple whitespace characters after the interpreter name, and
it did not have any options, then the code would do nasty things trying to
process a (non-existent) option-string which "ended before it began"...
Submitted by: Morten Johansen
Approved by: re (dwhite)
jeff [Sat, 18 Jun 2005 18:17:03 +0000 (18:17 +0000)]
- Try to catch the wrong bufobj panics a little earlier. I believe they
are actually caused by a buf with both VNCLEAN and VNDIRTY set. In
the traces it is clear that the buf is removed from the dirty queue while
it is actually on the clean queue which leaves the tail pointer set.
Assert that both flags are not set in buf_vlist_add and buf_vlist_remove.
Sponsored by: Isilon Systems, Inc.
Approved by: re (blanket vfs)
cracauer [Fri, 17 Jun 2005 17:10:16 +0000 (17:10 +0000)]
Add the ID of my Thinkpad R40. Makes the module detect and with the
exception of fans everything seems to work fine. No ill effects
observed.
Reviewed by: Nate Lawson (on acpi list)
Approved by: re (Ken Smith)
jeff [Fri, 17 Jun 2005 01:05:13 +0000 (01:05 +0000)]
- Fix a leaked reference to a vnode via v_dd. We rely on cache_purge() and
cache_zap() to clear the v_dd pointers when a directory vnode is forcibly
discarded. For this to work, all vnodes with v_dd pointers to a directory
must also have name cache entries linked via v_cache_dst to that dvp
otherwise we could not find them at cache_purge() time. The following
code snipit could break this guarantee by unlinking a directory before
fetching it's dotdot. The dotdot lookup would initialize the v_dd field
of the unlinked directory which could never be cleared. To fix this
we don't initialize v_dd for orphaned vnodes.
printf("rmdir: %d\n", rmdir("../foo")); /* foo is cwd */
printf("chdir: %d\n", chdir(".."));
printf("%s\n", getwd(NULL));
Sponsored by: Isilon Systems, Inc.
Discovered by: kkenn
Approved by: re (blanket vfs)
marcel [Thu, 16 Jun 2005 18:06:38 +0000 (18:06 +0000)]
Some chipset drivers redefine the busspace_isa_{io|mem} tags. This
not only means that it's possible (though unlikely) that we hand out
differing tags for the same bus space, it also means that the tags
we handed out are not used during bus enumeration. Both affect our
ability to compare tags. Fix the first by initializing our tags only
once. Fix the second by testing if one of the tags to compare is our
tag and the other is a busspace_isa_{io|mem} tag and declare them
equal if so.
This fixes using uart(4) as the serial console on a ds10. That is,
the low-level console worked, but we could not match the resources
to one of the UARTs found during bus enumeration, which prevented
uart(4) from becoming the console in single- or multi-user mode.
Approved by: re (kensmith)
MFC after: 2 days
Thanks to: all involved in getting a ds10 to me; directly or indirectly.
Special thanks to: Dave Knight, ISC (for not scratching my Porsche :-)
alc [Thu, 16 Jun 2005 17:06:34 +0000 (17:06 +0000)]
Increase UMA_BOOT_PAGES to prevent a crash during initialization. See
http://docs.FreeBSD.org/cgi/mid.cgi?42AD8270.8060906 for a detailed
description of the crash.
Reported by: Eric Anderson
Approved by: re (scottl)
MFC after: 3 days
green [Thu, 16 Jun 2005 15:43:17 +0000 (15:43 +0000)]
Ifdef out the incomplete non-blocking IO implementation for NFS
pending discussion of how implementation would proceed. Applications
like -lc_r expect select(3) to match the EAGAIN-status of IO
functions.
mlaier [Thu, 16 Jun 2005 14:55:58 +0000 (14:55 +0000)]
In verify_rev_path6():
- do not use static memory as we are under a shared lock only
- properly rtfree routes allocated with rtalloc
- rename to verify_path6()
- implement the full functionality of the IPv4 version
cognet [Thu, 16 Jun 2005 13:21:52 +0000 (13:21 +0000)]
Don't pass the kernel_pmap to pmap_fault_fixup() if the fault comes from
kernel mode, always use the curthread pmap instead. There are valid cases
were we can fault on a user address from the kernel without pcb_onfault
being set.
imp [Thu, 16 Jun 2005 06:51:38 +0000 (06:51 +0000)]
Add standard GPL boilerplate to these files. They are the only ones
contaminated with the GPL code. While this information was present in
the COPYRIGHT.INFO file, it is FreeBSD's standard practice to, where
possible, include explicit license information in files.
jeff [Thu, 16 Jun 2005 04:41:42 +0000 (04:41 +0000)]
- Change holdcnt use around vnode recycling. We now always keep a holdcnt
ref while we're calling vgone(). This prevents transient refs from
re-adding us to the free list. Previously, a vfree() triggered via
vinvalbuf() getting rid of all of a vnode's pages could place a partially
destructed vnode on the free list where vtryrecycle() could find it. The
first call to vtryrecycle would hang up on the vnode lock, but when it
failed it would place a now dead vnode onto the free list, and another
call to vtryrecycle() would free an already free vnode. There were many
complications of having a zero ref count while freeing which can now go
away.
- Change vdropl() to release the interlock before returning. All callers
now respect this, so vdropl() directly frees VI_DOOMED vnodes once the
last ref is dropped. This means that we'll never have VI_DOOMED vnodes
on the free list.
- Seperate v_incr_usecount() into v_incr_usecount(), v_decr_usecount() and
v_decr_useonly(). The incr/decr split is so that incr usecount can
return with the interlock still held while decr drops the interlock so
it can call vdropl() which will potentially free the vnode. The calling
function can't drop the lock of an already free'd node. v_decr_useonly()
drops a usecount without droping the hold count. This is done so the
usecount reaches zero in vput() before we recycle, however the holdcount
is still 1 which prevents any new references from placing the vnode
back on the free list.
- Fix vnlrureclaim() to vhold the vnode since it doesn't do a vget(). We
wouldn't want vnlrureclaim() to bump the usecount since this has
different semantics. Also change vnlrureclaim() to do a NOWAIT on the
vn_lock. When this function runs we're usually in a desperate situation
and we wouldn't want to wait for any specific vnode to be released.
- Fix a bunch of misc comments to reflect the new behavior.
- Add vhold() and vdrop() to vflush() for the same reasons that we do in
vlrureclaim(). Previously we held no reference and a vnode could have
been freed while we were waiting on the lock.
- Get rid of vlruvp() and vfreehead(). Neither are used. vlruvp() should
really be rethought before it's reintroduced.
- vgonel() always returns with the vnode locked now and never puts the
vnode back on a free list. The vnode will be freed as soon as the last
reference is released.
Sponsored by: Isilon Systems, Inc.
Debugging help from: Kris Kennaway, Peter Holm
Approved by: re (blanket vfs)
wilko [Wed, 15 Jun 2005 19:41:24 +0000 (19:41 +0000)]
Update hardware support. Add note on TGA. Remove DEFPA FDDI (it did
not work when I last tried). Tell people to not spend money on anything
less than EV5 machines.
dd [Wed, 15 Jun 2005 10:13:04 +0000 (10:13 +0000)]
Correctly handle an input file without a newline on the last line (and
avoid the confusing error message about the line being too long). This
change uses fgetln to detect the right conditions, but the fixed-width
line buffer is kept because too many other places in the program make
assumptions about its maximum width.
lesi [Wed, 15 Jun 2005 02:27:41 +0000 (02:27 +0000)]
Move couple of directories out of mtree and into their respective
ports. This mtree now specifies basic structure of X11BASE, similarly
to BSD.local.dist.
No objections on: freebsd-x11@
Approved by: re (dwhite), portmgr
jeff [Tue, 14 Jun 2005 20:31:53 +0000 (20:31 +0000)]
- In reassignbuf() add many asserts to validate the head and tail pointers
of the clean and dirty lists. This is in an attempt to catch the wrong
bufobj problem sooner.
- In vgonel() don't acquire an extra reference in the active case, the
vnode lock and VI_DOOMED protect us from recursively cleaning.
- Also in vgonel() clean up some stale comments.
Sponsored by: Isilon Systems, Inc.
Approved by: re (blanket vfs)
brooks [Tue, 14 Jun 2005 17:47:31 +0000 (17:47 +0000)]
Move if_alloc() higher in the attach function so sc->ifp is populated
early. I've moved it all the way to the top rather than part way up as
the submitter did.
Submitted by: Jung-uk Kim <jkim at niksun dot com>
Reported by: submitter, le, dougb
Approved by: re (ifnet blanket)
krion [Tue, 14 Jun 2005 15:05:43 +0000 (15:05 +0000)]
Implement @noinst field which has at the moment the same meaning and
function as @comment has. But will be valid only for files and not
for md5 sums, rcsid's and comments in the future.
ru [Tue, 14 Jun 2005 07:50:44 +0000 (07:50 +0000)]
Put the description of the -c option in the right place, as
promised by the Argument List Processing section introduction.
What follows the option in the options list is its long name,
not its argument (as is the case for the -c option). Also
sort references in the SEE ALSO section.