We don't export individual snapshots, so mnt_export field in snapshot's
mount point is NULL. That's why when we try to access snapshots over NFS
use mnt_export field from the parent file system.
When we automatically mount snapshot we want to return vnode of the mount point
from the lookup and not covered vnode. This is one of the fixes for using .zfs/
over NFS.
Fix reference count leak for a case where snapshot's mount point is updated.
Such situation is not supported.
This problem was triggered by something like this:
# zpool create tank da0
# zfs snapshot tank@snap
# cd /tank/.zfs/snapshot/snap (this will mount the snapshot)
# cd
# mount -u nosuid /tank/.zfs/snapshot/snap (refcount leak)
# zpool export tank
cannot export 'tank': pool is busy
Alexander Motin [Tue, 8 Sep 2009 05:46:38 +0000 (05:46 +0000)]
Do not check proper request alignment here in geom_dev in production.
It will be checked any way later by g_io_check() in g_io_schedule_down().
It is only needed here to not trigger panic from additional check, when
INVARIANTS enabled. So cover it with #ifdef INVARIANTS. It saves two
64bit divisions per request.
Tim Kientzle [Tue, 8 Sep 2009 05:02:41 +0000 (05:02 +0000)]
Fiz /usr/bin/unzip: A bug deep in libarchive's read-ahead logic
(incorrect handling of zero-length reads before the copy buffer is
allocated) is masked by the iso9660 taster. Tar and cpio both enable
that taster so were protected from the bug; unzip is susceptible.
This both fixes the bug and updates the test harness to exercise
this case.
Submitted by: Ed Schouten diagnosed the bug and drafted a patch
MFC after: 7 days
Tim Kientzle [Tue, 8 Sep 2009 04:52:12 +0000 (04:52 +0000)]
Update tests to match r195873, which corrected how hardlinked files
on iso9660 images were returned. While I'm poking around, update
some comments around this area to try to clarify what's going on and
what still remains to be improved.
Sean Bruno [Mon, 7 Sep 2009 23:16:27 +0000 (23:16 +0000)]
A few enhancements I made while working on the Firewire target (sbp_targ).
Update the error handling in a couple of cases to exit gracefully if
certain mandatory conditions aren't met.
Reduce the maximum number of initiators to 8 for this example code. While
1024 is more correct, this example code would act like it was stalled out
even though it was merely allocating the needed structures in init_ccbs()
If we have to use avl_find(), optimize a bit and use avl_insert() instead of
avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).
Fix similar case in the code that is currently commented out.
When snapshot mount point is busy (for example we are still in it)
we will fail to unmount it, but it won't be removed from the tree,
so in that case there is no need to reinsert it.
This fixes a panic reproducable in the following steps:
Ken Smith [Mon, 7 Sep 2009 17:54:20 +0000 (17:54 +0000)]
Bring the layout of package-split.py more in line with where we're going
with packages on the release media. It looks like we'll be putting just
the doc packages on the new "memory stick" image as well as disc1. There
will be no other packages on the CDROM-sized media. The DVD sized media
will include the doc packages plus whatever other packages we decide to
make part of the release.
This commit just brings the basic structure in line with being able to
do this. We still need to discuss with various people exactly which
packages will be included on the DVD.
If the environement variable "PKG_DVD" is set a tree suitable for the
DVD media is generated. Otherwise a tree suitable for the "memory stick"
and disc1 is generated.
When joining a multicast group, the inp_lookup_mcast_ifp call
does a KASSERT that the group address is multicast, so the
check if this is indeed true and eventually return a EINVAL if not,
should be done before calling inp_lookup_mcast_ifp. This fixes a kernel
crash when calling setsockopt (sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,...)
with invalid group address.
If a race is detected, pfs_vncache_alloc() may reclaim a vnode that had
never been inserted into the pfs_vncache list. Since pfs_vncache_free()
does not anticipate this case, it decrements pfs_vncache_entries
unconditionally; if the vnode was not in the list, pfs_vncache_entries
will no longer reflect the actual number of list entries. This may cause
size of the cache to exceed the configured maximum. It may also trigger
a panic during module unload or system shutdown.
Do not decrement pfs_vncache_entries for the vnode that was not in the
list.
Submitted by: tegge
Reviewed by: des
MFC after: 1 week
insmntque_stddtr() clears vp->v_data and resets vp->v_op to
dead_vnodeops before calling vgone(). Revert r189706 and corresponding
part of the r186560.
Noted and reviewed by: tegge
Approved by: des (pseudofs part)
MFC after: 3 days
Import a vendor fix for a list overrun.
This has been considered as a security hole on some specialized ml,
but currently the secteam@ doesn't consider that way.
Reviewed by: emaste, des
Sponsored by: Sandvine Incorporated
MFC after: 3 days
Alexander Motin [Sun, 6 Sep 2009 19:33:13 +0000 (19:33 +0000)]
MFp4:
Remove msleep() timeout from g_io_schedule_up/down(). It works fine
without it, saving few percents of CPU on high request rates without
need to rearm callout twice per request.
Alexander Motin [Sun, 6 Sep 2009 14:23:26 +0000 (14:23 +0000)]
Remove constraint, requiring request data to fulfill controller's alignment
requirements. It is busdma task, to manage proper alignment by loading
data to bounce buffers.
PR: kern/127316
Reviewed by: current@
Tested by: Ryan Rogers
The clear_remove() and clear_inodedeps() call vn_start_write(NULL, &mp,
V_NOWAIT) on the non-busied mount point. Unmount might free ufs-specific
mp data, causing ffs_vgetf() to access freed memory.
In fhopen, vfs_ref() the mount point while vnode is unlocked, to prevent
vn_start_write(NULL, &mp) from operating on potentially freed or reused
struct mount *.
Remove unmatched vfs_rel() in cleanup.
Noted and reviewed by: tegge
Tested by: pho
MFC after: 3 days
Ed Schouten [Sun, 6 Sep 2009 10:27:45 +0000 (10:27 +0000)]
Move ptmx into pty(4).
Now that pty(4) is a loadable kernel module, I'd better move /dev/ptmx
in there as well. This means that pty(4) now provides almost all
pseudo-terminal compatibility code. This means it's very easy to test
whether applications use the proper library interfaces when allocating
pseudo-terminals (namely posix_openpt and openpty).
In the NEXTADDR macro use SA_SIZE() rather than directly using
sizeof(), as introduced in r186119, for advancing the current
position into the buffer.
See comment in net/route.h for a description of the difference.
This makes ndp -s work again.
Qing Li [Sat, 5 Sep 2009 16:50:55 +0000 (16:50 +0000)]
This patch fixes an address scope violation. Considering the
scenario where an anycast address is assigned on one interface,
and a global address with the same scope is assigned on another
interface. In other words, the interface owns the anycast
address has only the link-local address as one other address.
Without this patch, "ping6" the anycast address from another
station will observe the source address of the returned ICMP6
echo reply has the link-local address, not the global address
that exists on the other interface in the same node.
Qing Li [Sat, 5 Sep 2009 16:43:16 +0000 (16:43 +0000)]
This patch fixes the following issues:
- Interface link-local address is not reachable within the
node that owns the interface, this is due to the mismatch
in address scope as the result of the installed interface
address loopback route. Therefore for each interface
address loopback route, the rt_gateway field (of AF_LINK
type) will be used to track which interface a given
address belongs to. This will aid the address source to
use the proper interface for address scope/zone validation.
- The loopback address is not reachable. The root cause is
the same as the above.
- Empty nd6 entries are created for the IPv6 loopback addresses
only for validation reason. Doing so will eliminate as much
of the special case (loopback addresses) handling code
as possible, however, these empty nd6 entries should not
be returned to the userland applications such as the
"ndp" command.
Since both of the above issues contain common files, these
files are committed together.
Warner Losh [Sat, 5 Sep 2009 08:38:25 +0000 (08:38 +0000)]
These checks against BUSY aren't needed: the newbus layer does this
already with the appropriate locks held... There's no need to do it
here, so just delete the checks.
Warner Losh [Sat, 5 Sep 2009 08:08:14 +0000 (08:08 +0000)]
Note migration of tunable from hw.bus.devctl_disable to
hw.bus.devctl_queue. The sysctl interface provides legacys upport for
the latter sysctl, but the tunable support was removed.
Jack F Vogel [Fri, 4 Sep 2009 22:45:07 +0000 (22:45 +0000)]
If an interface is brought up with no cable it will experience
watchdog resets, this is due to a missing check for link in the
new multiqueue start code.
Sam Leffler [Fri, 4 Sep 2009 22:34:57 +0000 (22:34 +0000)]
must also plumb static wep keys to the local sta db in sta mode; not
sure when this became necessary and might be caused by some missing
code to do auto-configuration of DWDS usage
Alexander Motin [Fri, 4 Sep 2009 19:20:46 +0000 (19:20 +0000)]
Remove artificial MAX_IO_SIZE constant, equal to DFLTPHYS * 2. Use MAXPHYS
instead. It is NULL change for GENERIC kernel, but allows 'fast' mode to
work on systems with increased MAXPHYS.
Alexander Motin [Fri, 4 Sep 2009 18:21:40 +0000 (18:21 +0000)]
Add to `camcontrol cmd` support for sending arbitrary ATA commands.
It could be used for broad range of tasks, such as configuring drive
power management modes, caching, security and any other features and tasks,
not supported by existing drivers.
If crypto operation is finished with EAGAIN, don't repeat operation from
the return context, but from the original context.
Before repeating operation clear DONE flag and error.
Reviewed by: sam
Obtained from: Wheel Sp. z o.o. (http://www.wheel.pl)
Remove 'ad:' prefix from disk serial number. We don't want serial number
to change when we reconnect the disk in a way that it is accessible through
CAM for example.
1) Remove single occurance of HAS_CTYPE ifdef, ctype functions
used here for a long time and needs their header in anycase.
2) Add (unsigned char) casts to more ctype macros.
3) Simplify menu input handling using ctype instead of range unguarded
hardcoded tricks.