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.
imp [Tue, 14 Jun 2005 03:40:01 +0000 (03:40 +0000)]
Don a flack jacket and start to document the FreeBSD bus_space
implementation. I took the NetBSD man page, and hacked it to, I hope,
to reflect the preliminary version of the bus space that Justin Gibbs
committed as part of the CAM integration in FreeBSD 3.0.
This isn't perfect, but it is better than we have now (which is, ahem,
nothing). Please coordinate changes to the file through me through
the 6.0 release.
peter [Tue, 14 Jun 2005 02:43:45 +0000 (02:43 +0000)]
Fix syscons on amd64. The SC_PIXEL_MODE commit from May 29th added a new
function pointer to the vga render dispatch table and initialized it with
vga_nop. The problem is that vga_nop() is a varargs function, and the
table declares a non-varargs function pointer. On amd64 (and I think ppc),
mixing varargs and non-varargs function pointers is fatal.
Change vga_nop() and gfb_nop() from varargs to non-varargs do-nothing
functions. This stops the stack corruption that only happened on amd64.
jeff [Tue, 14 Jun 2005 01:14:40 +0000 (01:14 +0000)]
- Remove vnode lock asserts at the end of vfs syscalls. These asserts were
used to ensure that we weren't exiting the syscall with a lock still
held. This wasn't safe, however, because we'd already executed a vput()
and on a loaded system the vnode may have been free'd by the time we
assert. This functionality is also handled by the td_locks assert in
userret, which doesn't tell you what the syscall was, but will at least
panic before you deadlock.
Sponsored by: Isilon Systems, Inc.
Discovred by: Peter Holm
Approved by: re (blanket vfs)