In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were
replaced by file relative sector numbers as the buffer block number when
zero-padding a file during extension. Revert the change, it causes wrong
blocks filled with zeroes on seeking beyond end of file.
PR: kern/47628
Submitted by: tegge
MFC after: 3 days
When setting error to EINVAL in 'fvp == tdvp' case, jump to out label,
because if not, the error will be later overwritten by
mac_vnode_check_rename_to() call.
Style: Use ARCHIVE_VERSION_NUMBER to conditionalize tests on
the particular libarchive version being tested instead of the
deprecated ARCHIVE_API_VERSION and ARCHIVE_VERSION_STAMP macros.
MfP4: set/unset tracking for atime, ctime, mtime, and size fields.
This generalizes the existing set/unset tracking for hardlink/symlink
fields and extends it to cover non-string fields. Eventually, this
will be further extended to cover most fields.
In particular, this is needed to correctly detect when time fields
are missing (for example, reading ustar archives doesn't set atime or
ctime) for proper time restore and is helpful when trying to determine
whether to overwrite data when restoring hardlinks.
obrien [Sun, 31 Aug 2008 23:38:28 +0000 (23:38 +0000)]
Turn cc_tools/Makefile and Makefile.tgt into a "linear" read. Shared
parts of the configuration aren't duplicated, and arch-specific exceptions
are made "in-place". Also clean up the FreeBSD/amd64 config a little.
gshapiro [Sun, 31 Aug 2008 18:21:15 +0000 (18:21 +0000)]
A no-op commit to simulate the effect of a forced commit so the file
has a new timestamp as needed for mergemaster. A more long term
solution to this is needed since svn doesn't support forced commits.
yar [Sun, 31 Aug 2008 14:27:59 +0000 (14:27 +0000)]
pkill(1) first appeared in /usr/bin, but later it was moved to /bin
for the convenience of rc.d. Now it has happily lived there for quite
a while. So move the pkill(1) source files from usr.bin to bin, too.
rwatson [Sun, 31 Aug 2008 13:16:45 +0000 (13:16 +0000)]
In UDPv6, reduce scope of global udbinfo lock during append to last
matching socket by dropping it before udp6_append(), and remove
duplicate unlocks of udbinfo and inpcb in sysctl return path.
ed [Sun, 31 Aug 2008 10:17:40 +0000 (10:17 +0000)]
Disable processing of output data after disabling scroll lock by force.
The syscons code disabled scroll lock inside sc_cnputs() if it's going
to print a system message. The code currently wants to process any TTY
output data as well, but we cannot do this, because the TTY lock is a
sleep mutex, while cnputs() picks up a spin mutex.
Disable the code for now. It solves a panic when a console message is
printed while scroll lock is enabled. One solution would be to
initialize a task structure here.
kientzle [Sun, 31 Aug 2008 07:06:02 +0000 (07:06 +0000)]
Make libarchive_test a little smarter about trying to find
its reference files when you don't specify -r. It now checks
a couple of likely nearby directories to see if any of them
have a particular known file.
imp [Sun, 31 Aug 2008 03:22:19 +0000 (03:22 +0000)]
All the other routines returned EIO from the param routine. Return it
from umodem and ufoma.
With these changes, umodem kinda works for me now. It certainly gets
past the "tip" bug that I found earlier where 115200 wasn't a valid
baud rate. This was "broken" in the mpsafetty commit, but in reality,
umodem was always broken.
csjp [Sat, 30 Aug 2008 20:58:34 +0000 (20:58 +0000)]
Improve the entropy of the source port randomization for network address
translation. It turns out this is useful for applications which require
source port randomization for security (i.e. dns servers).
marius [Sat, 30 Aug 2008 16:03:22 +0000 (16:03 +0000)]
- Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around
errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1,
USIIIi erratum #1).
- Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII
and beyond. This is done so that these functions will still mask
the debug bits of spitfire-class CPUs once we increase TD_PA_BITS
to match the number of bits used for the PA by cheetah-class CPUs.
- Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the
context of the mappings entered. This is more or less cosmetic as
TLB_CTX_KERNEL is 0.
- Now that we have to distinguish between different sun4u CPUs in
the loader anyway, no longer do trial and error when reading the
portid property.
stas [Sat, 30 Aug 2008 15:16:40 +0000 (15:16 +0000)]
- Try to look for MAC address in all SA registers, not only in the
first one. U-boot, for example, uses the second register to store
MAC.[1]
- Use random MAC address if none configured instead of failing.
attilio [Sat, 30 Aug 2008 13:20:35 +0000 (13:20 +0000)]
- Improve some witness_watch operability in code which does perform both
lock tracking and checks, doing just the former ones.
- Fix a bug where sysctl utility was printing crazy values when setting a
new value for debug.witness.watch [0]
ed [Sat, 30 Aug 2008 09:18:27 +0000 (09:18 +0000)]
Fix some edge cases in the TTY queues:
- In the current design, when a TTY decreases its baud rate, it tries to
shrink the queues. This may not always be possible, because it will
not free any blocks that are still filled with data.
Change the TTY queues to store a `quota' value as well, which means it
will not free any blocks when changing the baud rate, but when placing
blocks back into the queue. When the amount of blocks exceeds the
quota, they get freed.
It also fixes some edge cases, where TIOCSETA during read()/
write()-calls could actually make the queue a tiny bit bigger than in
normal cases.
- Don't leak blocks of memory when calling TIOCSETA when the device
driver abandons the TTY while allocating memory.
- Create ttyoutq_init() and ttyinq_init() to initialize the queues,
instead of initializing them by hand. The new TTY snoop driver also
creates an outq, so it's good to have a proper interface to do this.
rnoland [Sat, 30 Aug 2008 01:00:18 +0000 (01:00 +0000)]
Don't return EINVAL when trying to unlock.
anholt thinks that he added this check as part of some regression testing,
but it is failing at least some of the time. I don't want to remove it
just yet. I added a bit of debugging to help identify the issue.
gnn [Fri, 29 Aug 2008 20:42:58 +0000 (20:42 +0000)]
Fix a bug whereby multicast packets that are looped back locally
wind up with the incorrect checksum on the wire when transmitted via
devices that do checksum offloading.
PR: kern/119635
Reviewed by: rwatson
MFC after: 5 days
marius [Fri, 29 Aug 2008 20:31:41 +0000 (20:31 +0000)]
For chips with a broken DC_ISR_RX_STATE which f.e. never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle (see also r163774), we have no choice
than to call mii_tick(9) unconditionally even in the case of the
DC_REDUCED_MII_POLL handling as far as the RX side is concerned.
This isn't necessarily worse than checking whether RX is idle
though because unlike as with TX we're racing with the hardware,
which might receive packets any time while we poll the MII, anyway.
Reported and tested by: Jacob Owens
Reviewed by: yongari
MFC after: 3 days
jhb [Fri, 29 Aug 2008 20:30:30 +0000 (20:30 +0000)]
Add the ability to run /usr/sbin/crashinfo on a new core dump automatically
during boot. Right now this is disabled by default, but it can be enabled
by setting 'crashinfo_enable=YES' in rc.conf.
jkim [Fri, 29 Aug 2008 19:10:51 +0000 (19:10 +0000)]
- Directly match code wherever possible instead of using macros.
- Macrofy bitmap table lookup. Constify the table while I am here.
- Add missing continue statements in the for loop.
Functionally it should be the last remaining fix from:
pjd [Fri, 29 Aug 2008 18:10:18 +0000 (18:10 +0000)]
By default backup geli metadata to a file. It is quite critical 512 bytes,
once it is lost, all data is gone.
Option '-B none' can by used to prevent backup. Option '-B path' can be
used to backup metadata to a different file than the default, which is
/var/backups/<prov>.eli.
The 'geli init' command also prints backup file location and gives short
procedure how to restore metadata.
The 'geli setkey' command now warns that even after passphrase change or keys
update there could be version of the master key encrypted with old
keys/passphrase in the backup file.
Add regression tests to verify that new functionality works as expected.
Update other regression tests so they don't create backup files.
Reviewed by: keramida, rink
Dedicated to: a friend who lost 400GB of his live by accidentally overwritting geli metadata
MFC after: 2 weeks
attilio [Fri, 29 Aug 2008 15:47:53 +0000 (15:47 +0000)]
- Make witness_watch a 3 state value.
1 means that witness is up and running.
0 means that witness is disabled but that it can be established later
again in effective way.
-1 means that witness is disabled permanently
- Fix a bug causing kernel to panic on witness disabling through
witness_watch. lock lists queues were still full of entries and this was
causing throubles with debugging stubs (like witness_thread_exit()).
ed [Fri, 29 Aug 2008 15:05:34 +0000 (15:05 +0000)]
Restore assertion that was removed in r182444.
While merging back my changes from Perforce, it seemed I removed a
locking assertion that still applies to ttydisc_rint_poll(). Restore it,
because it may come in handy.
ed [Fri, 29 Aug 2008 15:02:50 +0000 (15:02 +0000)]
Backport two small fixes from the MPSAFE TTY branch in Perforce:
- Implement IMAXBEL. It turned out the IMAXBEL termios switch was marked
as supported, while it had not been implemented.
- Don't go into the high watermark when in canonical mode, no data has
been canonicalized and the input buffer is full. This caused the
terminal to lock up. This prevented users from pressing
backspace/^U/etc in such cases.
This could easily be simulated by pasting a very big amount of data in
a shell with sh(1) in canonical mode.
sam [Fri, 29 Aug 2008 05:02:10 +0000 (05:02 +0000)]
Fix mic calculation when final data is entirely in a trailing mbuf;
it's unclear if this can happen on freebsd but does appear on netbsd.
Identified by Matthias Drochner who came up with an initial change
that we then revised together.
scottl [Fri, 29 Aug 2008 04:39:46 +0000 (04:39 +0000)]
Fix a locking mistake in daopen(). If the open fails, which can happen
because the media was removed, the periph would get its refcount dropped
and ultimately freed before getting unlocked. This created a dangling
pointer that was easy to trip over. This fixes a common source of
crashes with removaable media, but problems remain and will get tracked
down.
scottl [Fri, 29 Aug 2008 01:23:16 +0000 (01:23 +0000)]
Work again to fix the interrupt masking problems. We now recognize
that there are 3 different interrupt enable bits, 2 for different
families of cards, and 1 for when MSI is used. Also apply a big
hammer backstop for cards that aren't recognized. This should fix
all of the interrupt issues at boot.
jfv [Thu, 28 Aug 2008 22:28:28 +0000 (22:28 +0000)]
Update to igb driver:
- changes in support of the VLAN filter fix to 126850
- removal of a bunch of legacy code that was cruft, if not
possibly harmful.
- removal of POLLING from this driver, with multiqueue and
MSIX it just makes no sense here.
- Fix an LRO bug that I've been working on internally, intermittent
panics under stress, the problem was releasing the RX ring lock
before the LRO flushing.
- Following the above fix I now enable LRO by default
- For performance reasons increase the default number of RX queues
to 4.
- Add AIM - "Adaptive Interrupt Moderation", a fancy way of saying
that the EITR value is dynamically changed based on the size of
packets in the last interrupt interval.
rrs [Thu, 28 Aug 2008 20:31:24 +0000 (20:31 +0000)]
ok, non static the function and put in the .h so
when we do INVARANT compile the compiler will not
dis the function that is not used. Hmm maybe I should have
made it ifndef INVARIANTs..
ed [Thu, 28 Aug 2008 19:34:58 +0000 (19:34 +0000)]
Make ureadc() warn when holding any locks, just like uiomove().
A couple of months ago I was quite impressed, because when I was writing
code, I discovered that uiomove() would not allow any locks to be held,
while ureadc() did, mainly because ureadc() is implemented using the
same building blocks as uiomove().
Let's see if this triggers any aditional witness warnings on our source
tree.