Commit Graph

2370 Commits

Author SHA1 Message Date
Rick Macklem
5b41805237 MFC: r205663
Patch the experimental NFS server in a manner analagous to r205661
for the regular NFS server, to ensure that ESTALE is
returned to the client for all errors returned by VFS_FHTOVP().
2010-04-09 01:33:12 +00:00
Rick Macklem
0bbe1d9baa MFC: r205572
Fix the experimental NFS subsystem so that it uses the correct
preprocessor macro name for not requiring strict data alignment.
2010-04-07 15:19:52 +00:00
Nathan Whitehorn
4ccf64eb2b MFC r205014,205015:
Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
of the kernel and enhances the freebsd32 compatibility code to support
big-endian platforms.

This MFC is required for MFCs of later changes to the freebsd32
compatibility from HEAD.

Requested by:	kib
2010-04-07 02:24:41 +00:00
Edward Tomasz Napierala
bd7ae20991 MFC r197680:
Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
this commit makes implementation of either of these two mandatory.

Reviewed by:	kib
2010-03-27 17:22:11 +00:00
Edward Tomasz Napierala
e8db802864 MFC r197650:
Fix typo in the comment.
2010-03-27 16:35:25 +00:00
Konstantin Belousov
9e211e5715 MFC r204475:
Mark msdosfs as mpsafe.
2010-03-24 14:56:56 +00:00
Konstantin Belousov
3d9ee8abe2 MFC r204589:
Do not leak vnode lock when msdosfs mount is updated and specified
device is different from the device used to the original mount.
2010-03-24 14:53:28 +00:00
Konstantin Belousov
a8428ad0f1 MFC r204474:
Fix the race between dotdot lookup and forced unmount, by using
msdosfs-specific variant of vn_vget_ino(), msdosfs_deget_dotdot().

As was done for UFS, relookup the dotdot denode after the call to
msdosfs_deget_dotdot(), because vnode lock is dropped and directory
might be moved.

MFC r204675:
When returning error from msdosfs_lookup(), make sure that *vpp is NULL.
2010-03-24 14:50:04 +00:00
Konstantin Belousov
7825951721 MFC r204473:
Use pm_fatlock to protect per-filesystem rb tree used to allocate fileno
on the large FAT volumes.
2010-03-24 14:45:50 +00:00
Konstantin Belousov
255ca65791 MFC r204472:
Add assertions for FAT bitmap state.
2010-03-24 14:43:19 +00:00
Konstantin Belousov
05ecce0c28 MFC r204471:
Use pm_fatlock to protect fat bitmap.
2010-03-24 14:37:17 +00:00
Konstantin Belousov
3a141f45c5 MFC r204470:
Add per-mountpoint lockmgr lock for msdosfs.

MFC r204576:
Only destroy pm_fatlock on error if it was initialized.
2010-03-24 14:25:15 +00:00
Konstantin Belousov
670baf9dfe MFC r204469:
In msdosfs deget(), properly handle the case when the vnode is found in hash.
2010-03-24 14:18:10 +00:00
Konstantin Belousov
ac8743bcd3 MFC r204468:
In msdosfs_inactive(), reclaim the vnodes both for SLOT_DELETED and
SLOT_EMPTY deName[0] values.
2010-03-24 14:15:46 +00:00
Konstantin Belousov
b2c1c014b3 MFC r204467:
Remove seemingly unneeded unlock/relock of the dvp in msdosfs_rmdir,
causing LOR.
2010-03-24 14:13:27 +00:00
Konstantin Belousov
1a07617f97 MFC r204466:
Assert that the msdosfs vnode is (e)locked in several places.
Change the check and return on impossible condition into KASSERT().
2010-03-24 14:10:08 +00:00
Konstantin Belousov
99cb1f2430 MFC r204465:
Remove unused global statistic about fat cache usage.
2010-03-24 14:08:01 +00:00
Jung-uk Kim
a0bc6d1ca6 MFC: r205223
Fix a long standing regression of readdir(3) in fdescfs(5) introduced
in r1.48.  We were stopping at the first null pointer when multiple file
descriptors were opened and one in the middle was closed.  This restores
traditional behaviour of fdescfs.
2010-03-22 20:36:35 +00:00
Konstantin Belousov
e623216f38 MFC r203827:
- Add idempotency guards so the structures can be used in other utilities.
- Update bpb structs with reserved fields.
- In direntry struct join deName with deExtension. Although a
  fix was attempted in the past, these fields were being overflowed,
  Now this is consistent with the spec, and we can now share the
  WinChksum code with NetBSD.
2010-02-27 16:51:23 +00:00
Konstantin Belousov
3588e7da23 MFC r203866:
Invalid filesystem might cause the bp to be never read.
2010-02-21 11:13:15 +00:00
Konstantin Belousov
fe5e746617 MFC r203826:
Use M_ZERO instead of calling bzero().
Fix function name in the comment.

MFC r203828:
Fix function name in the comment in the second location too.
2010-02-20 11:58:19 +00:00
Konstantin Belousov
bc6c9c912c MFC r203822:
Remove unused macros.
2010-02-20 11:54:18 +00:00
Rick Macklem
3ed680d8da MFC: r203849
Change the default value for vfs.newnfs.enable_locallocks to 0 for
the experimental NFS server, since local locking is known to be
broken and the patch to fix it is still a work in progress.
2010-02-19 16:36:08 +00:00
Rick Macklem
3322939bbb MFC: r203848
This fixes the experimental NFS server so that it won't crash in the
caching code for IPv6 by fixing a typo that used the incorrect variable.
It also fixes the indentation of the statement above it.

Reported by:	simon AT comsys.ntu-kpi.kiev.ua
2010-02-18 16:23:13 +00:00
Rick Macklem
16a11310f0 MFC: r203303
Patch the experimental NFS client so that there is a timeout
for negative name cache entries in a manner analogous to
r202767 for the regular NFS client. Also, make the code in
nfs_lookup() compatible with that of the regular client
and replace the sysctl variable that enabled negative name
caching with the mount point option.
2010-02-14 00:43:42 +00:00
Rick Macklem
0668507346 MFC: r203119
Patch the experimental NFS client in a manner analogous to
r203072 for the regular NFS client. Also, delete two fields
of struct nfsmount that are not used by the FreeBSD port of
the client.
2010-02-11 21:25:48 +00:00
Marius Strobl
36a153df8b MFC: r202903
On LP64 struct ifid is 64-bit aligned while struct fid is 32-bit aligned
so on architectures with strict alignment requirements we can't just simply
cast the latter to the former but need to copy it bytewise instead.

PR:		143010
2010-01-31 17:43:22 +00:00
Rick Macklem
8c271f6707 MFC: r201442
The test for "same client" for the experimental nfs server over NFSv4
was broken w.r.t. byte range lock conflicts when it was the same client
and the request used the open_to_lock_owner4 case, since lckstp->ls_clp
was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp".
2010-01-17 20:49:34 +00:00
Rick Macklem
05cb54875e MFC: r201439
Fix three related problems in the experimental nfs client when
checking for conflicts w.r.t. byte range locks for NFSv4.
1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK.
2 - Check for "same file" when checking for a conflict.
3 - Don't check for a conflict for the F_UNLCK case.
2010-01-17 20:18:59 +00:00
Rick Macklem
ea6ffaa742 MFC: r201345
Fix the experimental NFS client so that it can create Unix
domain sockets on an NFSv4 mount point. It was generating
incorrect XDR in the request for this case.

Tested by:	infofarmer
2010-01-14 17:35:07 +00:00
Brooks Davis
43ede8f5fe MFC r201954:
Update the comment on printing group membership to reflect that fact
  that each group the process is a member of is printed rather than
  an entry for each group the user could be a member of.
2010-01-12 06:11:36 +00:00
Rick Macklem
6049e7fcf7 MFC: r201029
When porting the experimental nfs subsystem to the FreeBSD8 krpc,
I added 3 functions that were already in the experimental client
under different names. This patch deletes the functions in the
experimental client and renames the calls to use the other set.
(This is just removal of duplicated code and does not fix any bug.)
2010-01-11 19:30:23 +00:00
Rick Macklem
d3db09cb06 MFC: r200999
Modify the experimental server so that it uses VOP_ACCESSX().
This is necessary in order to enable NFSv4 ACL support. The
argument to nfsvno_accchk() was changed to an accmode_t and
the function nfsrv_aclaccess() was no longer needed and,
therefore, deleted.

Reviewed by:	trasz
2010-01-08 20:25:59 +00:00
Jaakko Heinonen
e15f9ffcb0 MFC r198291:
Unloading of the nfscl module is unsupported because newnfslock doesn't
support unloading. It's not trivial to implement newnfslock unloading so
for now just admit that unloading is unsupported and refuse to attempt
unload in all nfscl module event handlers.

Approved by:	trasz (mentor)
2009-12-31 07:34:38 +00:00
Jaakko Heinonen
44aa9b63f6 MFC r198290:
Fix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
be called after ncl_uninit() when unloading the nfscl module because
ncl_uninit() uses ncl_iod_mutex which is destroyed in nfscl_modevent().

Approved by:	trasz (mentor)
2009-12-31 07:32:04 +00:00
Jaakko Heinonen
d2129b5030 MFC r198289:
Fix comment typos.

Approved by:	trasz (mentor)
2009-12-31 07:28:43 +00:00
Xin LI
205c44d9cd MFC r200287:
Allow using IPv6 in nfsrvd_sentcache() callback.

PR:		kern/141289
Submitted by:	Petr Lampa <lampa fit vutbr cz>
2009-12-15 01:14:33 +00:00
Rick Macklem
6d54ecd38f MFC: r199715
Modify the experimental nfs server so that it falls back to
using VOP_LOOKUP() when VFS_VGET() returns EOPNOTSUPP in the
ReaddirPlus RPC. This patch is based upon one by pjd@ for the
regular nfs server which has not yet been committed. It is needed
when a ZFS volume is exported and ReaddirPlus (which almost
always happens for NFSv4) is performed by a client. The patch
also simplifies vnode lock handling somewhat.

Tested by:	gerrit at pmp.uni-hannover.de
2009-12-08 22:41:37 +00:00
Rick Macklem
52b239b029 MFC: r199616
Patch the experimental NFS server is a manner analagous to
r197525, so that the creation verifier is handled correctly
in va_atime for 64bit architectures. There were two problems.
One was that the code incorrectly assumed that
sizeof (struct timespec) == 8 and the other was that the tv_sec
field needs to be assigned from a signed 32bit integer, so that
sign extension occurs on 64bit architectures. This is required
for correct operation when exporting ZFS volumes.

Tested by:	gerrit at pmp.uni-hannover.de
Reviewed by:	pjd
2009-12-08 22:28:55 +00:00
Attilio Rao
7f7bb30263 MFC r199007:
Fix a memory leak.
2009-11-22 16:09:27 +00:00
Konstantin Belousov
ce8e32de5c MFC r197428:
Add per-process osrel node to the procfs, to allow read and set p_osrel
value for the process.
2009-10-29 16:19:58 +00:00
Rick Macklem
8760cb9afb MFC r197048:
Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs
vnodes, since these nodes are not linked into the mount queue and,
as such, the vn_lock() cannot cause a deadlock so LORs are harmless.

Suggested by: kib
Approved by:	re (kensmith), kib (mentor)
2009-09-14 15:16:17 +00:00
Konstantin Belousov
3f6296aa26 MFC r196921:
Do not decrement pfs_vncache_entries for the vnode that was not in the
pfs_vncache list.

Approved by:	re (bz)
2009-09-14 11:01:15 +00:00
Konstantin Belousov
b67ca8999b MFC r196920:
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.

Approved by:	re (kensmith)
2009-09-10 12:42:36 +00:00
Konstantin Belousov
a0ed3d8546 MFC r196689:
Remove spurious pfs_unlock().

Approved by:	re (rwatson)
2009-09-05 13:10:54 +00:00
Jilles Tjoelker
33656b91cd MFC r196460
Fix the conformance of poll(2) for sockets after r195423 by
  returning POLLHUP instead of POLLIN for several cases. Now, the
  tools/regression/poll results for FreeBSD are closer to that of the
  Solaris and Linux.

  Also, improve the POSIX conformance by explicitely clearing POLLOUT
  when POLLHUP is reported in pollscan(), making the fix global.

  Submitted by:	bde
  Reviewed by:	rwatson

MFC r196556

  Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

  This reverts part of r196460, so that sockets only return POLLHUP if both
  directions are closed/error. Fifos get POLLHUP by closing the unused
  direction immediately after creating the sockets.

  The tools/regression/poll/*poll.c tests now pass except for two other
  things:
  - if POLLHUP is returned, POLLIN is always returned as well instead of
    only when there is data left in the buffer to be read
  - fifo old/new reader distinction does not work the way POSIX specs it

  Reviewed by:	kib, bde

MFC r196554

  Add some tests for poll(2)/shutdown(2) interaction.

Approved by:	re (kensmith)
2009-09-01 20:58:41 +00:00
Marko Zec
83864c810e MFC r196503:
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
  context inside the RPC code.

  Temporarily set td's cred to mount's cred before calling socreate() via
  __rpc_nconf2socket().

  Submitted by: rmacklem (in part)
  Reviewed by:  rmacklem, rwatson
  Discussed with:       dfr, bz
  Approved by:  re (rwatson), julian (mentor)

Approved by:	re (rwatson)
2009-08-28 19:12:44 +00:00
Rick Macklem
8d3f6febcd MFC r196332:
Apply the same patch as r196205 for nfs_upgrade_lock() and
nfs_downgrade_lock() to the experimental nfs client.

Approved by:	re (kensmith), kib (mentor)
2009-08-17 18:11:50 +00:00
Robert Watson
530c006014 Merge the remainder of kern_vimage.c and vimage.h into vnet.c and
vnet.h, we now use jails (rather than vimages) as the abstraction
for virtualization management, and what remained was specific to
virtual network stacks.  Minor cleanups are done in the process,
and comments updated to reflect these changes.

Reviewed by:	bz
Approved by:	re (vimage blanket)
2009-08-01 19:26:27 +00:00
John Baldwin
87eca70e0c Fix some LORs between vnode locks and filedescriptor table locks.
- Don't grab the filedesc lock just to read fd_cmask.
- Drop vnode locks earlier when mounting the root filesystem and before
  sanitizing stdin/out/err file descriptors during execve().

Submitted by:	kib
Approved by:	re (rwatson)
MFC after:	1 week
2009-07-31 13:40:06 +00:00