Commit Graph

150263 Commits

Author SHA1 Message Date
Jaakko Heinonen
c64b097bfc - If lstat()/stat() fails with an error other than ENOENT, don't ignore
the error and assume that the file doesn't exist. Touch could return
  success with -c option even if the file existed and time was not set.
- If the first utimes_f() call fails with -A option, give up and don't
  continue trying to set times to current time. [1]
- Set exit status to 1 when setting of timestamps fails for a directory
  or symbolic link even though lstat()/stat() would succeed.
- Don't print bogus error message when rw() succeeds.

PR:		bin/112213
Submitted by:	jilles [1]
Reviewed by:	jilles
Approved by:	trasz (mentor)
2009-10-16 20:52:45 +00:00
John Baldwin
12ac99dc46 Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory
remains unchanged and discard any -ve cache entries for a directory when
they notice that the modification time of a directory entry changes.  The
race involves two concurrent lookups as follows:
- Thread A does a lookup for file 'foo' which sends a lookup RPC to the
  server.  The lookup fails and the server replies.
- The 'foo' file is created (either by the same client or a different
  client) updating the modification time on the parent directory of 'foo'.
- Thread B does a lookup for a different file 'bar' which updates the
  cached attributes of the parent directory of 'foo' to reflect the new
  modification time after 'foo' was created.
- Thread A finally resumes execution to parse the reply from the NFS
  server.  It adds a -ve cache entry and sets the cached value of the
  directory's modification time that is used for invalidating -ve cached
  lookups to the new modification time set by thread B.

At this point, future lookups of 'foo' will honor the -ve cached entry
until the cached entry is pushed out of the name cache's LRU or the
modification time of the parent directory is changed again by some other
change.  The fix is to read the directory's modification time before
sending the lookup RPC and use that cached modification time when setting
the directory's cached modification time.  Also, we do not add a -ve cache
entry if another thread has added -ve cache entry that set the directory's
cached modification time to a newer value than the value we read before
sending the lookup RPC.

Reviewed by:	rmacklem
MFC after:	1 week
2009-10-16 19:30:48 +00:00
Jilles Tjoelker
f6196ed2d4 sh: Show more information about syntax errors in command substitution:
the line number where the command substitution started.
This applies to both the $() and `` forms but is most useful for ``
because the other line number is relative to the enclosed text there.
(For older versions, -v can be used as a workaround.)
2009-10-16 16:17:57 +00:00
Christian Brueffer
7024354df3 Sort SEE ALSO. 2009-10-16 12:32:07 +00:00
Konstantin Belousov
051f6f8a7a Move intr_describe() out of #ifdef SMP; the function is always required.
Reviewed by:	jhb
2009-10-16 12:00:59 +00:00
Doug Barton
0e22665fc7 Allow $name_program to override $command in a more robust way that
will not cause the value to be null if $command is not set.
2009-10-15 23:20:23 +00:00
Andrew Thompson
290512231a Correct offset calcluation for the NCM implementation.
Submitted by:	HPS
2009-10-15 20:15:29 +00:00
Andrew Thompson
c3139ea6f9 Only poll ukbd if KDB is active.
Submitted by:	HPS
2009-10-15 20:09:27 +00:00
Andrew Thompson
1def609a63 Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.

Submitted by:	avg
Reviewed by:	jhb
2009-10-15 20:07:08 +00:00
John Baldwin
d0c9a29169 Use language more closely resembling English in a panic message.
Pointy hat to:	jhb
Submitted by:	pluknet
2009-10-15 18:51:19 +00:00
Ruslan Ermilov
92573623b9 Removed redundant WARNS setting.
Submitted by:	Ulrich Spörlein
2009-10-15 18:17:29 +00:00
Luigi Rizzo
ed8c4b44e6 Support the specification of a range of destination ports e.g.
netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration]

This is useful to test the behaviour of systems that do some kind
of flow classifications and so exhibit different behaviour depending
on the number of flows that hit them.
I plan to add a similar extension to sweep on a range of IP addresses,
so we can issue a single command to flood (obviously, for testing
purposes!) a number of different destinations.

When there is only one destination, we do a preliminary connect()
of the socket so we can use send() instead of sendto().
When we have multiple ports, the socket is not connect()'ed and we
do a sendto() instead. There is a performance hit in this case,
as the throughput on the loopback interface (with a firewall rule
that blocks the transmission) goes down from 900kpps to 490kpps on
my test machine.

If the number of different destinations is limited, one option to
explore is to have multiple connect()ed sockets.

MFC after:	1 month
2009-10-15 15:30:41 +00:00
John Baldwin
8dfed8b0a1 Style fixes to the function prototypes for bus_alloc_resources() and
bus_release_resources().
2009-10-15 14:55:11 +00:00
John Baldwin
37b8ef16cd Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64 and i386 by having
  the nexus(4) driver supply a custom bus_describe_intr method that invokes
  a new intr_describe() MD routine which in turn looks up the associated
  interrupt event and invokes intr_event_describe_handler().

Requested by:	many
Reviewed by:	scottl
MFC after:	2 weeks
2009-10-15 14:54:35 +00:00
Luigi Rizzo
54dd21686d A small change to avoid calling gettimeofday() too often
(hardwired to once every 20us at most).

I found out that on many machines round here, i could only get
300-400kpps with netsend even on loopback and a 'deny' rule in
the firewall, while reducing the number of calls to gettimeofday()
brings the value to 900kpps and more.

This code is just a quick fix for the problem. Of course it could be
done better, with proper getopt() parsing and the like, but since
this applies to the entire program i'll postpone that to when i have
more time.

Reviewed by:	rwatson
MFC after:	1 month
2009-10-15 14:18:35 +00:00
John Baldwin
a0f1535205 Fix a sign bug in the handling of nice priorities when computing the
interactive score for a thread.

Submitted by:	Taku YAMAMOTO  taku of tackymt.homeip.net
Reviewed by:	jeff
MFC after:	3 days
2009-10-15 11:41:12 +00:00
Christian Brueffer
a2ef0aff10 Use our standard section 4 SYNOPSIS.
MFC after:	3 days
2009-10-15 11:32:05 +00:00
Robert Watson
c8359dde47 Print routing statistics as unsigned short rather than unsigned int,
otherwise sign extension leads to unlikely values when in the negative
range of the signed short structure fields that hold the statistics.
The type used to hold routing statistics is arguably also incorrect.

MFC after:	3 days
2009-10-15 10:31:24 +00:00
Hiroki Sato
9a7ee195f5 Bump version numbers and update descriptions for the 9-CURRENT
world. The %[no]include.historic knobs are removed because they
are not used for a long time.
2009-10-15 07:58:01 +00:00
Qing Li
93704ac5d7 This patch fixes the following issues in the ARP operation:
1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.

Reviewed by:	kmacy
MFC after:	3 days
2009-10-15 06:12:04 +00:00
Weongyo Jeong
941da6d392 fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.

MFC after:	3 days
2009-10-14 20:30:27 +00:00
Weongyo Jeong
db63fc93cc fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.

MFC after:	3 days
Tested by:	bsduser <bsd at acd.homelinux.org>
2009-10-14 20:09:09 +00:00
Robert Noland
e80d42dda2 Set the active flag in the PMBR when we install bootcode on a GPT
partitioned disk.  Some BIOS require this to be set before they will
boot the device.

Approved by:	marcel
MFC after:	2 weeks
2009-10-14 19:24:01 +00:00
John Baldwin
38d3501a8e Oops, add a return values section to note that these routines return an error
on failure or zero on success.
2009-10-14 16:00:20 +00:00
John Baldwin
2783151570 Add a manual page for BUS_BIND_INTR() and bus_bind_intr().
MFC after:	1 week
2009-10-14 15:58:59 +00:00
John Baldwin
a944fb4cc3 Use zfs_read() instead of xfsread() to read /boot.config. xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Submitted by:	Johny Mattsson  johny-freebsd of earthmagic org
Reviewed by:	dfr
MFC after:	3 days
2009-10-14 14:13:42 +00:00
Bjoern A. Zeeb
14c129fc3e Explicitly compare to a return code.
Discussed with:	philip (after we both misread the logic there the 1st time)
MFC after:	6 weeks
2009-10-14 12:01:11 +00:00
Bjoern A. Zeeb
382e8b5ad9 Unbreak the VIMAGE build with IPSEC, broken with r197952 by
virtualizing the pfil hooks.
For consistency add the V_ to virtualize the pfil hooks in here as well.

MFC after:	55 days
X-MFC after:	julian MFCed r197952.
2009-10-14 11:55:55 +00:00
Jilles Tjoelker
5c3743e3bb ls: Make -p not inhibit following symlinks.
According to the man page, when neither -H/-L nor -F/-d/-l are given, -H is
implied. This agrees with POSIX, GNU ls and Solaris ls. This means that -p,
although it is very similar to -F, does not prevent the implicit following
of symlinks.

PR:		standards/128546
2009-10-13 21:51:50 +00:00
Jung-uk Kim
a192851496 Import ACPICA 20091013. 2009-10-13 21:27:35 +00:00
Jilles Tjoelker
680db4952e Make getcwd(3) faster, simpler and more compliant using *at syscalls.
It is no longer necessary to construct long paths consisting of repeated
"../" which may be slow to process and may exceed PATH_MAX.
2009-10-13 20:58:22 +00:00
Bjoern A. Zeeb
852da713c3 Compare pointer to NULL rather than 0.
MFC after:	1 month
2009-10-13 20:29:14 +00:00
Bjoern A. Zeeb
44b636910b Immediately after clearing a pending callout that didn't make it due
to the lock we hold, disable interrupts, and announce to the firmware
that we are shutting down. Especially do this before disabling blocks.

This makes some types of machines with asf enabled no longer hang upon
boot, when we start configuring the interface.

PR:			i386/96382, kern/100410, kern/122252, kern/116328
Reported by:		erwin
Hardware provided by:	TDC A/S
Reviewed by:		stas
Tested by:		stas
2009-10-13 20:22:12 +00:00
John Baldwin
b675ebba10 Sync with other GENERIC kernel configs:
- Move USB serial drivers earlier to match their placement in other kernel
  configs.
- Add descriptions to various USB drivers.
- Move the USB wireless drivers into a new section.
- Add ulscom to the list of USB serial drivers.
2009-10-13 19:04:01 +00:00
John Baldwin
55b6a401ef Move the USB wireless drivers down into their own section next to the USB
ethernet drivers.

Submitted by:	Glen Barber  glen.j.barber @ gmail
MFC after:	1 month
2009-10-13 19:02:03 +00:00
John Baldwin
5c1f214c37 Fix this module so it at least builds. Note that it isn't hooked up to
the build however, and ubser(4) is also not present in any kernel configs
(including NOTES).
2009-10-13 18:07:56 +00:00
Robert Watson
8c8ee3d3b8 Add C message catalogue entries for newer errnos: EBADMSG, EMULTIHOP,
ENOLINK, EPROTO, ENOTCAPABLE.

Submitted by:	Alan R. S. Bueno <alan.bsd at gmail.com>
MFC after:	3 days (most)
2009-10-13 17:57:06 +00:00
Ed Maste
6ff4bdaef5 Correct typo: thetime -> the time
PR:		docs/139447
Submitted by:	Guido Falsi  mad at madpilot dot net
2009-10-13 12:56:23 +00:00
John Baldwin
9599da5de8 Correct a copy/paste bug in a comment. lptclose() checks once a second to
see if the ppc hardware has gone idle rather than four times a second.
2009-10-13 12:23:28 +00:00
Rui Paulo
fe1b9e2ada Properly initialize the mesh conf capabilities byte.
MFC after:	2 days
2009-10-13 10:43:17 +00:00
Robert Watson
03ce247827 EXPORT_SYMS is not, in fact, required, for a dependent module to access
non-static symbols in a module they depend on, so remove dtrace symbols
from nfsclient's EXPORT_SYMS again.

Suggested by:	jhb
2009-10-13 09:21:20 +00:00
Ed Schouten
2e76e4c9b5 Make number(6) build with WARNS=6. 2009-10-13 06:25:53 +00:00
Alexander Nedotsukov
b6d632e4e8 Chase dependency changes in libgssapi_krb5 module introruced by
revision r197995.
2009-10-13 05:38:08 +00:00
Hiroki Sato
7590eb54ce Use printb() to display the "nd6 options=" line. 2009-10-12 21:11:50 +00:00
Mark Murray
68f7de574e We haven't installed usbdevs for many moons now, and it doesn't work any
more anyway. Add it to the "obsolete" list.
2009-10-12 21:10:28 +00:00
Hiroki Sato
aea0c7f367 Fix the 106/109 USB Japanese keyboard "underscore" issue.
Sun Type 6 USB keyboard support added in rev 1.46 conflicted with
some scan codes used in Japanese keyboards because the scan code
conversion routine was ambiguous for the overlapped codes.

PR:		ports/134005
Submitted by:	YAMASHIRO Jun
2009-10-12 19:19:08 +00:00
Robert Watson
99b5e2f1d2 Export DTrace symbols from nfsclient so that dtnfsclient can get to them.
This fixes DTrace with nfsclient built as a module.

MFC after:	3 days
Reported by:	markm
2009-10-12 18:59:31 +00:00
Robert Watson
4347e9fd66 Add a MODULE_DEPEND() on the NFS client from dtnfsclient so that dtnfsclient
can access NFS client symbols.

MFC after:	3 days
Discussed with:	kib
Reported by:	markm
2009-10-12 18:58:42 +00:00
Hiroki Sato
27f13d5d0f - Do not assign a link-local address when ND6_IFF_IFDISABLED.
Adding a tentative address is useless.

- Comment out a confused warning message when
  in6_ifattach_linklocal() fails.  This can occur when the
  interface does not support ioctl(SIOCAIFADDR) (interfaces
  associated with 802.11 wireless network device drivers, for
  example).
2009-10-12 18:54:02 +00:00
Alexander Nedotsukov
e62aa473c5 Link GSS mechanics modules against libgssapi so they will not fail due
unresolved symbol errors when in turn libgssapi was loaded with RTLD_LOCAL
flag set (which is the default).

Reviewed by:	dfr, jhb
MFC after:	3 days
2009-10-12 17:10:51 +00:00