3175 Commits

Author SHA1 Message Date
pfg
3933e2285a MFC r275645;
ext2fs: Fix old out-of-bounds access.

Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by
passing it to a function which accesses it at byte offset 59 using
argument 60UL.

The issue was inherited from an older FFS implementation and
fixed there with by merging UFS2 in r98542. We follow the
FFS fix.

CID:		1007665
Discussed with:	bde
2014-12-16 18:45:31 +00:00
trasz
964eff34c6 MFC r273852:
Fix handling of "conn" mount_nfs(8) option.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:48:47 +00:00
trasz
059653a03d MFC r273849:
Add support for "timeo", "actimeo", "noac", and "proto" options
to mount_nfs(8).  They are implemented on Linux, OS X, and Solaris,
and thus can be expected to appear in automounter maps.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:41:55 +00:00
trasz
11e554c92e MFC r272931:
Add assertion to catch duplicated nodes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:52:32 +00:00
trasz
44b7c0743b MFC r272836:
Remove remnants of some cleanup; no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:50:40 +00:00
trasz
5217262cb3 MFC r272743:
Simplify; no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:49:04 +00:00
trasz
a6df93e354 MFC r272512:
Make autofs use shared vnode locks.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:47:22 +00:00
trasz
f72fde1ec0 MFC r272471:
Fix autofs debug macros.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:45:34 +00:00
trasz
603b73d3cc MFC r272470:
Make autofs(4) use shared lock for lookups, instead of exclusive one.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:44:03 +00:00
trasz
c03d95d341 MFC r272405:
Call uma_zfree() outside of lock, and improve comment.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:42:11 +00:00
trasz
aba7b57a35 MFC r272403:
Make autofs timeout handling use timeout task instead of callout;
that's because the handler can sleep on sx lock.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:40:34 +00:00
rmacklem
1dc5bfe0b1 MFC: r273486
Clip the settings for the NFS rsize, wsize mount options
to a power of 2. For non-power of 2 settings, intermittent
page faults have been reported. Although the bug that causes
these page faults/crashes has not been identified, it does
not appear to occur when rsize, wsize is a power of 2.
2014-11-05 23:12:39 +00:00
kib
9b2eda21cd MFC r273727:
Original commit message was
Allow the vfs.nfsd knobs to be set from loader.conf (or using
kenv(8)).  This is useful when nfsd is loaded as module.

As I understand, automatic fetch from kenv does not work in stable/10.
Merge the change still, to reduce code difference.
2014-11-03 10:30:44 +00:00
araujo
7081823e48 MFC r273159:
Add two sysctl(8) to enable/disable NFSv4 server to check when setting
user nobody and/or setting group nogroup as owner of a file or directory.
Usually at the client side, if there is an username that is not in the
client's passwd database, some clients will send 'nobody@<your.dns.domain>'
in the wire and the NFSv4 server will treat it as an ERROR.
However, if you have a valid user nobody in your passwd database,
the NFSv4 server will treat it as a NFSERR_BADOWNER as its believes the
client doesn't has the username mapped.

Submitted by:	Loic Blot <loic.blot@unix-experience.fr>
Reviewed by:	rmacklem
Approved by:	rmacklem
Sponsored by:	QNAP Systems Inc.
2014-10-31 04:01:10 +00:00
hselasky
1f41d295fb MFC r263710, r273377, r273378, r273423 and r273455:
- De-vnet hash sizes and hash masks.
- Fix multiple issues related to arguments passed to SYSCTL macros.

Sponsored by:	Mellanox Technologies
2014-10-27 14:38:00 +00:00
kib
eb3582e16f MFC r273132:
Style changes for deadfs.
2014-10-22 09:12:20 +00:00
kib
dc7923c136 MFC r273131:
When vnode bypass cannot be performed on the cdev file descriptor for
read/write/poll/ioctl, call standard vnode filedescriptor fop.
2014-10-22 09:09:41 +00:00
kib
6809e3fc35 MFC r273130:
Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller
is interested in i/o state.  Return POLLNVAL for invalid bits, similar
to poll_no_poll().
2014-10-22 09:06:36 +00:00
kib
fafa0f4166 MFC r272952:
Do not set IN_ACCESS flag for read-only mounts.
2014-10-18 15:31:53 +00:00
pfg
5c298394b4 MFC r271467, r271468:
ext2fs: add ext2_getpages().

Literally copy/pasted from ffs_getpages().

Tested with:	fsx
2014-10-04 17:46:04 +00:00
trasz
22dfed7064 MFC r272025:
Fix thinko that, with two map entries like shown below, in that order,
made autofs mix them up: the second one wasn't visible in ls(1) output,
and trying to access it would trigger mount for the first one.

foobar          host:/foobar
foo             host:/foo

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2014-09-25 17:28:29 +00:00
trasz
0e88a7f8bf MFC r270507:
Fix bug that, assuming a/ is a root of NFS filesystem mounted on autofs,
prevented "mv a/from a/to" from working, while "cd a && mv from to" was ok.

PR:		192948
Sponsored by:	The FreeBSD Foundation
2014-08-31 21:58:07 +00:00
trasz
d1036ec04d MFC r270402:
Autofs softc needs to be global anyway, so don't pass it as a local
variable, and don't store in autofs_mount.  Also rename it from 'sc'
to 'autofs_softc', since it's global and extern.

Sponsored by:	The FreeBSD Foundation
2014-08-31 21:52:26 +00:00
trasz
2ded039a6d MFC r270399:
Add comment explaining one of the quirks in autofs.

Sponsored by:	The FreeBSD Foundation
2014-08-31 21:51:01 +00:00
trasz
87f90af6e4 MFC r270281:
Fix includes.

Suggested by:	pluknet@
Sponsored by:	The FreeBSD Foundation
2014-08-31 21:49:45 +00:00
trasz
ab3fae8a9e MFC r270276:
Use __FBSDID() properly.

Suggested by:	pluknet@
Sponsored by:	The FreeBSD Foundation
2014-08-31 21:48:12 +00:00
trasz
35b1298891 MFC r270207:
Rework ".." lookup; previous one failed to properly busy the mountpoint.

Reviewed by:	kib@
Sponsored by:	The FreeBSD Foundation
2014-08-31 21:43:28 +00:00
trasz
e8d76f86d2 MFC r270096:
Bring in the new automounter, similar to what's provided in most other
UNIX systems, eg. MacOS X and Solaris.  It uses Sun-compatible map format,
has proper kernel support, and LDAP integration.

There are still a few outstanding problems; they will be fixed shortly.

Reviewed by:	allanjude@, emaste@, kib@, wblock@ (earlier versions)
Phabric:	D523
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-08-31 21:18:23 +00:00
kib
396919643b MFC r269708:
Unlock ldvp and lock dvp to compensate for possible ldvp unlock in lower
VOP_LOOKUP() and dvp reclamation.  Use cached value of dvp->v_mount.
2014-08-22 07:09:54 +00:00
rmacklem
c64921fe8d MFC: r269771
Change the NFS server's printf related to hitting
the DRC cache's flood level so that it suggests
increasing vfs.nfsd.tcphighwater.
2014-08-16 21:36:22 +00:00
kib
e6e7535583 MFC r269347:
Do not generate 1000 unique lock names for nfsrc hash chain locks.
Shorten the names of some nfs mutexes.
2014-08-07 03:50:30 +00:00
kib
cec08c7294 MFC r269187:
Assert that nullfs vnode has VV_ROOT set whenever lower vnode has.
Assert that dotdot lookup on the root vnode is not performed.
2014-08-04 01:10:47 +00:00
rmacklem
672efbb4a9 MFC: r268273
The new NFSv3 server did not generate directory postop attributes for
the reply to ReaddirPlus when the server failed within the loop
that calls VFS_VGET(). This failure is most likely an error
return from VFS_VGET() caused by a bogus d_fileno that was
truncated to 32bits.
This patch fixes the server so that it will return directory postop
attributes for the failure. It does not fix the underlying issue caused
by d_fileno being uint32_t when a file system like ZFS generates
a fileno that is greater than 32bits.
2014-08-03 00:35:10 +00:00
rmacklem
50867d802b MFC: r268115
Merge the NFSv4.1 server code in projects/nfsv4.1-server over
into head. The code is not believed to have any effect
on the semantics of non-NFSv4.1 server behaviour.
It is a rather large merge, but I am hoping that there will
not be any regressions for the NFS server.
2014-08-01 21:10:41 +00:00
kib
f3b6e2c4bd MFC r268765:
Remove unused header.
2014-07-30 03:58:29 +00:00
kib
4af1d57b25 MFC r268764:
Check for the cross-device cross-link attempt in the VFS, instead of
VOP_LINK() implemenations.
2014-07-30 03:56:17 +00:00
kib
920342975e MFC r268766:
Do not ignore error from tmpfs_alloc_vp().
2014-07-28 01:25:49 +00:00
kib
12dac89c4e MFC r268617:
Rework the tmpfs unmount.
2014-07-28 01:23:59 +00:00
kib
20a6651181 MFC r268615:
Add OBJ_TMPFS_NODE flag.

MFC r268616:
Set the OBJ_TMPFS_NODE flag for vm_object of VREG tmpfs node.

MFC r269053:
Correct assertion. tmpfs vm object is always at the bottom of
the shadow chain.
2014-07-28 01:21:02 +00:00
kib
d2764792a7 MFC r268614:
Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs
dotdot lookup.
2014-07-28 01:16:07 +00:00
kib
86ba2f30ea MFC r268613:
Style.  Add comment about lock mode.
2014-07-28 01:14:25 +00:00
kib
2ac333b7af MFC r268611:
Replace goto's with the return.
2014-07-28 01:08:43 +00:00
kib
eb32c3f0ff MFC r268610:
Add convenience macro to assert tmpfs node lock.
2014-07-28 01:06:36 +00:00
kib
8c4ee72725 MFC r268609:
Add some assertions for the code handling vm_object for tmpfs vnode.
2014-07-28 01:04:33 +00:00
kib
1a878ba1c0 MFC r268608:
The tmpfs_link() must not dereference the filesystem-specific data for
a vnode until it is verified that the vnode indeed belongs to tmpfs mount.
2014-07-28 01:01:20 +00:00
kib
49b4c6d03e MFC r268606:
Generalize vn_get_ino() to allow filesystems to use custom vnode
producer. Convert inline copies of vn_get_ino() in msdosfs and cd9660
into the uses of vn_get_ino_gen().
2014-07-28 00:53:26 +00:00
kib
35e4a7c8ff MFC r268605:
Remove code separator lines which do not conform to style(9).
2014-07-28 00:43:42 +00:00
kib
979b1ce80a MFC r269081:
Fix typo.
2014-07-27 18:08:47 +00:00
bdrewery
cd7f6c0352 MFC r268114:
Change NFS readdir() to only ignore cookies preceding the given offset for
  UFS rather than for all but ZFS.
2014-07-21 22:21:09 +00:00
rmacklem
f7a09fd7e7 MFC: r268008
There might be a potential race condition for the NFSv4 client
when a newly created file has another open done on it that
update the open mode. This patch moves the code that updates
the open mode up into the block where the mutex is held to
ensure this cannot happen. No bug caused by this potential
race has been observed, but this fix is a safety belt to ensure
it cannot happen.
2014-07-13 00:19:39 +00:00