MFC r240464:
The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively,
which is an elaborate way to cause kernel panic. Change the VOPs
implementation to return EBADF for a reclaimed vnode.
Do not change owner, group, or mode when package database directory
and its contents are created with pkg_add(1). It may happen when the
packing list contains @owner, @group, or @mode.
MFC r239178, r239179, r239180, r239181, r239182 and r239299:
Fix detach of USB serial devices so that it doesn't block
the USB explore thread forever. To accomplish this two new
functions have been added to the kernel, to claim and free
the newbus allocated softc.
This change is backwards API compatible, but not binary
compatible. The FreeBSD version has been bumped to force
a recompile of all kernel modules.
isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
(download microcode with offsets, save, and activate).
SATI translation layer was incorrectly using allocation length instead
of blocks, and was constructing the ATA command incorrectly.
Also change #define to specify that the 512 block size here is
specific for DOWNLOAD_MICROCODE, and does not relate to the device's
logical block size.
In soreceive_generic() when checking if the type of mbuf has changed
check it for MT_CONTROL type too, otherwise the assertion
"m->m_type == MT_DATA" below may be triggered by the following scenario:
- the sender sends some data (MT_DATA) and then a file descriptor
(MT_CONTROL);
- the receiver calls recv(2) with a MSG_WAITALL asking for data larger
than the receive buffer (uio_resid > hiwat).
r240004:
In soreceive_generic() remove the optimization for the case when
MSG_WAITALL is set, and it is possible to do the entire receive
operation at once if we block (resid <= hiwat). Actually it might make
the recv(2) with MSG_WAITALL flag get stuck when there is enough space
in the receiver buffer to satisfy the request but not enough to open
the window closed previously due to the buffer being full.
The issue can be reproduced using the following scenario:
On the sender side do 2 send(2) requests:
1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
2) data of size equal to SOBUF_SIZE.
On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:
1) recv() data of SOBUF_SIZE / 10 size;
2) recv() data of SOBUF_SIZE size;
We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
and partial SOBUF_SIZE request. When the first request is processed we
get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
bytes for the second request, and soreceive_generic() blocks in the
part that is a subject of this change waiting for the rest. But the
window was closed when the buffer was filled and to avoid silly window
syndrome it opens only when available space is larger than sb_hiwat/4
or maxseg. So it is stuck and pending data is only sent via TCP window
probes.
Merge r240371:
When synchronizing, include in the config dump amount of
bytes syncronized.
The rationale behind this is the following: for large disks the
percent synchronisation counter ticks too seldom, and monitoring
software (as well as human operator) can't tell whether
synchronisation goes on or one of disks got stuck. On an idle
server one can look into gstat and see whether synchronisation goes
on or not, but on a busy server that won't work. Also, new value
monitored can be differentiated obtaining the synchronisation speed
quite precisely.
Submitted by: Konstantin Kukushkin <dark ramtel.ru>
Reviewed by: pjd
mandoc complains loudly when <TAB>s are misused in columnated lists. Fix
this syntax violation and while I'm here also convert <TAB> to Ta and adjust
quotation marks in order to prevent this problem in the future.
MFC r233667 by joel@:
Remove superfluous paragraph macro.
MFC r234568 by delphij@:
The .Fx macro needs the version number be in its own word separated by
a space. This change have no visible effect for rendering.
Merge r240146 from head:
- If the PCIe "SLOT" flag is set, include this in the capability output
- Fix printing of PCIe interrupt number, the shift was incorrect.
MFC r240465:
Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.
MFC r240465:
Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.
MFC r240252,r240253:
Remove documentation and www cvsup files as they are no longer useful
with the switch to subversion.
Specifically document that an incomplete ports tree is not supported.
Remove useless comment about sendmail.
According to a clarification at http://austingroupbugs.net/view.php?id=503
ptsname may set errno, so avoid saving and restoring errno across the
function.
Avoid mapping ENOENT to ENOTDIR for non-existent path components.
The ENOTDIR mapping was introduced in r235266 for kern/128933 based on
an interpretation of the somewhat ambiguous language in the POSIX realpath
specification. The interpretation is inconsistent with Solaris and Linux,
a regression from 9.0, and does not appear to be permitted by the
description of ENOTDIR:
20 ENOTDIR Not a directory. A component of the specified pathname
existed, but it was not a directory, when a directory was
expected.
MFC r239818:
- Don't take an account of locked memory for current process in vslock(9).
There are two consumers of vslock(9): sysctl code and drm driver. These
consumers are using locked memory as transient memory, it doesn't belong
to a process's memory.
MFC r239895:
- Remove accounting of locked memory from vsunlock(9) that I missed in r239818.
Do not increment the parent firmware's reference count when any other
firmware image in the module is registered. Instead, do it when the
other image is itself referenced.
This allows a module with multiple firmware images to be automatically
unloaded when none of the firmware images are in use.
- Pacific/Fiji will go into DST from 21 October 2012 till 20 January 2013.
- Fix offset for Pacific/Tokelau.
- Gaza and West Bank had DST from 29 March to 28 September 2012.
- Syria has DST from April till October
- Morocco had DST from April to September 2012 except for 20 July to 20 August.
- Cuba changed to DST from 1 April 2012 only.
- Haiti has DST between 8 March and 1 November in 2012.
dim [Wed, 12 Sep 2012 18:15:17 +0000 (18:15 +0000)]
MFC r239872:
Teach libdwarf about the DW_FORM_flag_present dwarf attribute, so
programs using libdwarf (such as ctfconvert) don't error out on files
containing the attribute.
dim [Wed, 12 Sep 2012 17:50:56 +0000 (17:50 +0000)]
MFC r239870:
Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't
error out on files that contain it. (This attribute can be emitted by
newer versions of clang.)
MFC r240286:
At least from A70M FCH chipsets AMD started to use their real vendor ID
(1022) in HPET. But according to report they still haven't fixed problem
with level-triggered interrupts.
Make workaround used for earlier chipsets apply to this new ID also.
Make sure that arraysz is initialized to a value larger than zero.
arraysz could get initialized to zero on ZFS because ZFS reports
directory sizes differently compared to UFS.
Add TRIM support, enabled by default.
Fix a bug installing components from a localPath.
Allow autosizing of any partition, not just the last partition.
Adjust how ZFS is laid out to work with Boot Environments.
Merge r238990 (manually resolving absence of r237263):
Fix races between in_lltable_prefix_free(), lla_lookup(),
llentry_free() and arptimer():
o Use callout_init_rw() for lle timeout, this allows us safely
disestablish them.
- This allows us to simplify the arptimer() and make it
race safe.
o Consistently use ifp->if_afdata_lock to lock access to
linked lists in the lle hashes.
o Introduce new lle flag LLE_LINKED, which marks an entry that
is attached to the hash.
- Use LLE_LINKED to avoid double unlinking via consequent
calls to llentry_free().
- Mark lle with LLE_DELETED via |= operation istead of =,
so that other flags won't be lost.
o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more
consistent and provide more informative KASSERTs.
The patch is a collaborative work of all submitters and myself.
PR: kern/165863
Submitted by: zont, rstone
Submitted by: Eric van Gyzen <eric_van_gyzen dell.com>
Merge r238989:
The llentry_update() is used only by flowtable and the latter
always passes NULL pointer to it. Thus, code can be simplified
and function renamed to llentry_alloc() to match rtalloc().
Merge r232054 by kmacy:
When using flowtable llentrys can outlive the interface with
which they're associated at which the lle_tbl pointer points
to freed memory and the llt_free pointer is no longer valid.
Move the free pointer in to the llentry itself and update the
initalization sites.
MFC r238471:
Implement DT_RUNPATH and -z nodefaultlib.
MFC note: The ld_library_path_rpath default value was flipped to true,
effectively reverting rtld back to the pre-patch behaviour, unless
LD_LIBRARY_PATH_RPATH environment variable is set and its value is 0/N/n.
Merge r238516 from head:
If ip_output() returns EMSGSIZE to tcp_output(), then the latter calls
tcp_mtudisc(), which in its turn may call tcp_output(). Under certain
conditions (must admit they are very special) an infinite recursion can
happen.
To avoid recursion we can pass struct route to ip_output() and obtain
correct mtu. This allows us not to use tcp_mtudisc() but call tcp_mss_update()
directly.
r238002 by tuexen@:
Remove dead code (on FreeBSD) as suggested by glebius@.
r238016:
Remove route caching from IP multicast routing code. There is no
reason to do that, and also, cached route never got unreferenced,
which meant a reference leak.
Reviewed by: bms
r238092:
When ip_output()/ip6_output() is supplied a struct route *ro argument,
it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning
here: it may be supplied to provide route, and it may be supplied to
store and return to caller the route that ip_output()/ip6_output()
finds. In the latter case skipping FLOWTABLE lookup is pessimisation.
The difference between struct route filled by FLOWTABLE and filled
by rtalloc() family is that the former doesn't hold a reference on
its rtentry. Reference is hold by flow entry, and it is about to
be released in future. Thus, route filled by FLOWTABLE shouldn't
be passed to RTFREE() macro.
- Introduce new flag for struct route/route_in6, that marks route
not holding a reference on rtentry.
- Introduce new macro RO_RTFREE() that cleans up a struct route
depending on its kind.
- All callers to ip_output()/ip6_output() that do supply non-NULL
but empty route should use RO_RTFREE() to free results of
lookup.
- ip_output()/ip6_output() now do FLOWTABLE lookup always when
ro->ro_rt == NULL.
change ALWAYS_ASSUME_YES to ASSUME_ALWAYS_YES for consistency with pkg(8)
if not on a tty prompt about the missing pkg(8) but default on 'no' except if
ASSUME_ALWAYS_YES is set
Make use of GEOM Gate direct reads feature. This allows HAST to serve
reads with native speed of the underlying provider.
There are three situations when direct reads are not used:
1. Data is being synchronized and synchronization source is the secondary
node, which means secondary node has more recent data and we should read
from it.
2. Local read failed and we have to try to read from the secondary node.
3. Local component is unavailable and all I/O requests are served from the
secondary node.
Extend GEOM Gate class to handle read I/O requests directly within the kernel.
This will allow HAST to read directly from the local component without
even communicating userland daemon.
Sponsored by: Panzura, http://www.panzura.com
r238868:
Reorder things in g_gate_create() so at the moment when g_new_geomf()
is called name is properly initialized.
Discussed with: pjd
r239131:
In g_gate_dumpconf() always check the result of g_gate_hold().
This fixes "Negative sc_ref" panic possible when sysctl_kern_geom_confxml()
is run simultaneously with destroying GATE device.
MFC r239769:
- Don't allow watchdogd(8) to be swapped out.
On machines with huge amount of swap and high IO activity,
watchdogd(8) may wait for a swap memory longer than timeout and
sometimes fires.
MFC r239896:
- It's also need to lock current memory.
dim [Sat, 8 Sep 2012 11:34:22 +0000 (11:34 +0000)]
MFC r239680:
Add libcxxrt's objects (prefixing them with cxxrt_ to avoid collisions)
to libc++.a and libc++_p.a, to make static linking of C++ executables
with libc++ easier. This is similar to the approach used in libstdc++.
MFC r239686:
When using -stdlib=libc++, add the correct dependency to .depend in
bsd.prog.mk.
For building libstdc++ and libsupc++, filter out any -stdlib=libc++
option from CXXFLAGS, otherwise these libraries will not build.
Similarly, filter out any -std=xxx options that aren't supported.
MFC r230454:
Use provided name when allocating ksid domain. It isn't really used on FreeBSD,
but should fix a panic when pool is imported from another OS that is using this.
No objections from; pjd
Approved by: cperciva (implicit)
dim [Fri, 7 Sep 2012 18:03:29 +0000 (18:03 +0000)]
MFC r239962:
Fix a twelve year old bug in readelf: when process_dynamic_segment()
encounters a DT_RUNPATH entry, the global dynamic_info[] array is
overrun, causing some other global variable to be overwritten.
In my testcase, this was the section_headers variable, leading to
segfaults or jemalloc assertions when it was freed later on.
Thanks to Koop Mast for providing samples of a few "bad" .so files.