Commit Graph

179059 Commits

Author SHA1 Message Date
mckusick
5b7b29e35b This change creates a new list of active vnodes associated with
a mount point. Active vnodes are those with a non-zero use or hold
count, e.g., those vnodes that are not on the free list. Note that
this list is in addition to the list of all the vnodes associated
with a mount point.

To avoid adding another set of linkage pointers to the vnode
structure, the active list uses the existing linkage pointers
used by the free list (previously named v_freelist, now renamed
v_actfreelist).

This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loops
over just the active vnodes associated with a mount point (typically
less than 1% of the vnodes associated with the mount point).

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks
2012-04-20 06:50:44 +00:00
delphij
17ad55bc6e Fix build. 2012-04-20 04:40:39 +00:00
ed
496747a17a Do a better job at determining the username of the login session.
When multiple users share the same UID, the old code will simply pick an
arbitrary username to attach to the utmpx entries. Make the code a bit
more accurate by first checking whether getlogin() returns a username
which corresponds to the uid of the calling process. If this fails,
simply fall back to picking an arbitrary username.

Reported by:	saurik on GitHub
MFC after:	2 weeks
2012-04-19 21:12:08 +00:00
pluknet
bb79f10054 - Update the rest of struct ithd references.
- net_ih and softclock_ih cookies have gone away.

MFC after:	1 week
2012-04-19 16:13:15 +00:00
tuexen
62e631ede2 Whitespace changes.
MFC after: 3 days
2012-04-19 15:30:15 +00:00
pluknet
359a7bc8fb Document swi_remove(9).
Reviewed by:	jhb
MFC after:	1 week
2012-04-19 15:29:09 +00:00
ed
d553b8dea8 Properly use SHA1_Final() instead of SHA_Final().
In this case it doesn't really matter, as long as we turn a TTY name
into a set of shuffled bytes. Still, for correctness we should use the
proper function.

MFC after:	2 weeks
2012-04-19 15:28:15 +00:00
tuexen
a2f2c50988 Use the same pattern for mbuf logging everywhere.
MFC after: 3 days
2012-04-19 13:11:17 +00:00
tuexen
591060458a Fix reported errno.
MFC after: 3 days
2012-04-19 12:47:18 +00:00
tuexen
9035fb1c4c Fix a bug where we copy out more data from a mbuf chain that are
actually in it. This happens when SCTP receives an unknown chunk, which
requires the sending of an ERROR chunk, and there is no final padding but
the chunk is not 4-byte aligned.
Reported by yueting via rwatson@

MFC after: 3 days
2012-04-19 12:43:19 +00:00
mav
fdb56713f2 Add to GEOM RAID class module for reading non-degraded RAID5 volumes and
some environment to differentiate 4 possible RAID5 on-disk layouts.

Tested with Intel and AMD RAID BIOSes.

MFC after:	2 weeks
2012-04-19 12:30:12 +00:00
adrian
a1620c9905 Stop using the hardware register value byte order swapping for now,
at least until I can root cause what's going on.

The only platform I've seen this on is the AR9220 when attached to
the AR71xx CPUs.  I get immediate PCIe bus errors and all subsequent
accesses cause further MIPS bus exceptions.  I don't have any other
big-endian platforms to test this on.

If I get a chance (or two), I'll try to whack this on a bus analyser
and see exactly what happens.

I'd rather leave this on, especially for slower, embedded platforms.
But the #ifdef hell is something I'm trying to avoid.
2012-04-19 03:26:21 +00:00
obrien
248502d7f0 Update file(1) to version 5.11. 2012-04-19 03:20:13 +00:00
dteske
86e3fa59a2 Add my birth date/place to the calendar as new committer.
Approved by:	emaste (mentor)
2012-04-18 22:56:46 +00:00
mckusick
a9a210460f Delete a no longer useful VNASSERT missed during changes in 234400.
Suggested by: kib
2012-04-18 19:34:20 +00:00
mckusick
be8731298f Fix a memory leak of M_VNODE_MARKER introduced in 234386.
Found by:  Peter Holm
2012-04-18 19:30:22 +00:00
dteske
164dd155ca Add myself as a new committer.
Approved by:	emaste (mentor)
2012-04-18 18:35:19 +00:00
marcel
eafad8f503 Compensate for the replacement of uart_cpu_{amd64|i386}.c with
uart_cpu_x86.c

Pointy hat: marcel
2012-04-18 17:44:05 +00:00
jpaetzel
c2311c8567 Unbreak tinderbox.
Fix FreeBSD paradigms in the upstream code.

PR:	bin/166933
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
2012-04-18 16:47:57 +00:00
gnn
afbfcbc9fd Set SIGCANCEL to SIGTHR as part of some cleanup of DTrace code.
Reviewed by:	davidxu@
MFC after:	1 week
2012-04-18 16:29:55 +00:00
maxim
9da257a75d o FreeBSD 8.3-RELEASE added. 2012-04-18 15:23:21 +00:00
jh
ce0372c7aa Return EOPNOTSUPP rather than EPERM for the SF_SNAPSHOT flag because
tmpfs doesn't support snapshots.

Suggested by:	bde
2012-04-18 15:22:08 +00:00
jh
60a904bd9e The part about exec atime no longer applies in the comment.
Pointed out by:	bde
2012-04-18 15:19:00 +00:00
trasz
58e08d00ab Style. 2012-04-18 13:50:17 +00:00
thomas
2a2a4b0668 Fix typo in comment 2012-04-18 12:50:13 +00:00
marck
a91354cc7e VMware environments are not unusual now. Add VMware partitions recognition
(both MBR for ESXi <= 4.1 and GPT for ESXi 5) to g_part.

Reviewed by:	ae
Approved by:	ae
MFC after:	2 weeks
2012-04-18 11:59:03 +00:00
kib
5e01c3a9e2 Fix string buffer overflow when preparing the line of output.
PR:	bin/161739
Submitted by:	Jeremy Chadwick <freebsd jdc parodius com>
MFC after:	1 week
2012-04-18 10:23:42 +00:00
mav
91acf8bc72 Some improvements to GEOM MULTIPATH:
- Implement "configure" command to allow switching operation mode of
running device on-fly without destroying and recreation.
 - Implement Active/Read mode as hybrid of Active/Active and Active/Passive.
In this mode all paths not marked FAIL may handle reads same time,
but unlike Active/Active only one path handles write requests at any
point in time. It allows to closer follow original write request order
if above layers need it for data consistency (not waiting for requisite
write completion before sending dependent write).
 - Hide duplicate messages about device status change.
 - Remove periodic thread wake up with 10Hz rate.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2012-04-18 09:42:14 +00:00
mav
0d3166270c Alike to SCSI make adaclose() to not return error if device gone.
This fixes KASSERT panic inside GEOM if kernel built with INVARIANTS.

MFC after:	1 week
2012-04-18 08:55:26 +00:00
pluknet
7bb0591c26 Fix typo in ".PATH" 2012-04-18 07:02:53 +00:00
thompsa
8379680eec Remove KASSERTS, they do not add any value here since the pointer is about to
be derefernced anyway.
2012-04-18 01:39:14 +00:00
jasone
279f465fd3 Import jemalloc b57d3ec571c6551231be62b7bf92c084a8c8291c (dev branch,
prior to 3.0.0 release), which supports atomic operations based on atomic(9).
This should fix build failures for several platforms.
2012-04-17 22:05:55 +00:00
mckusick
841f20af50 Drop export of vdestroy() function from kern/vfs_subr.c as it is
used only as a helper function in that file. Replace sole call to
vbusy() with inline code in vholdl(). Replace sole calls to vfree()
and vdestroy() with inline code in vdropl().

The Clang compiler already inlines these functions, so they do not
show up in a kernel backtrace which is confusing. Also you cannot
set their frame in kgdb which means that it is impossible to view
their local variables. So, while the produced code is unchanged,
the debugging should be easier.

Discussed with: kib
MFC after:      2 weeks
2012-04-17 21:46:59 +00:00
jasone
be041b2157 Update directions on how to disable malloc debugging. 2012-04-17 20:35:54 +00:00
jasone
9f5c60ebce Add an UPDATING entry for the contrib/jemalloc import. 2012-04-17 20:21:04 +00:00
mckusick
ffee40eeff Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.
The primary changes are that the user of the interface no longer
needs to manage the mount-mutex locking and that the vnode that
is returned has its mutex locked (thus avoiding the need to check
to see if its is DOOMED or other possible end of life senarios).

To minimize compatibility issues for third-party developers, the
old MNT_VNODE_FOREACH interface will remain available so that this
change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH
will be removed in head.

The reason for this update is to prepare for the addition of the
MNT_VNODE_FOREACH_ACTIVE interface that will loop over just the
active vnodes associated with a mount point (typically less than
1% of the vnodes associated with the mount point).

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks
2012-04-17 16:28:22 +00:00
trasz
7f09aee7a1 Fix bug where NFSv4 ACL enforcement code wouldn't unconditionally
allow the owner to read and write ACL and file attributes when there
was no entry with subject matching the owner.  In other words,
'getfacl meh' shouldn't fail for the owner if the ACL looks like this:

# file: meh
# owner: trasz
# group: wheel
         user:root:------a-------:------:allow

Reported by:	kientzle
2012-04-17 14:54:00 +00:00
trasz
29ba0a35f6 Stop treating system processes as special. This fixes panics
like the one triggered by this:

# kldload geom_vinum
# pwait `pgrep -S gv_worker` &
# kldunload geom_vinum

or this:

GEOM_JOURNAL: Shutting down geom gjournal 3464572051.
panic: destroying non-empty racct: 1 allocated for resource 6

which were tracked by jh@ to be caused by checking p->p_flag,
while it wasn't initialised yet.  Basically, during fork, the code
checked p_flag, concluded the process isn't marked as P_SYSTEM,
incremented the counter, and later on, when exiting, checked that
the process was marked as P_SYSTEM, and thus didn't decrement it.

Also, I believe there wasn't any good reason for checking P_SYSTEM
in the first place.

Tested by:	jh
2012-04-17 14:31:02 +00:00
trasz
a41bb18a29 Fix panic, triggered like this: "int main() { thr_exit(); }"
Submitted by:	Mateusz Guzik
2012-04-17 13:44:40 +00:00
trasz
c37ffba90a Enforce upper bound on the input buffer length.
Reported by:	Mateusz Guzik
2012-04-17 13:28:14 +00:00
mav
ef881c3335 Add some more SCSI mode pages from SPC-4 spec.
MFC after:	1 week
2012-04-17 11:13:03 +00:00
trasz
aa6b6972ad Fix panic at boot with SD/MMC readers with no media present, introduced
at r234177.  Note that this is a temporary fix, until I come up with something
prettier.
2012-04-17 10:44:28 +00:00
jasone
cbeacb7c46 Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,
prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc.
The code being imported by this commit diverged from
lib/libc/stdlib/malloc.c in March 2010, which means that a portion of
the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries
for all subsequent releases.
2012-04-17 07:22:14 +00:00
adrian
1bc364bf7e Run the fatal proc as a proc, rather than where it currently is.
Otherwise the reset path will sleep, which it can't do in this context.
2012-04-17 06:02:41 +00:00
adrian
ab4c20c69d Fix the RX free list locking creation and destruction to be consistent
even in the face of errors.

If the RX descriptor list fails, the RX lock won't be initialised, but
then the DMA free path wil try freeing it.

This commit is brought to you by a working mwl(4).
2012-04-17 04:52:57 +00:00
adrian
c5d2215f58 Add missing #include 2012-04-17 04:31:50 +00:00
adrian
0e5c802c61 Style(9) and white space fixes. 2012-04-17 01:34:49 +00:00
adrian
23c6d6eeb0 Protect the PCI space registers behind a mutex.
Obtained from:	Linux/OpenWRT, Atheros
2012-04-17 01:22:59 +00:00
grehan
f3d41e0f81 Add x2apic MSR definitions
Reviewed by:	jhb
Obtained from:	bhyve via Neel via NetApp
2012-04-17 00:54:38 +00:00
jkim
c73bd7ac42 Fix a Clang warning.
Submitted by:	arundel
2012-04-16 23:29:12 +00:00