Commit Graph

791 Commits

Author SHA1 Message Date
yamt fc08656a20 implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.
2005-01-19 16:22:19 +00:00
chs 8975a0856f adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway.  there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.
2005-01-09 16:42:43 +00:00
yamt e5bd47dc3c invalidate cache if filesize is changed besides our activity
because it means that we're out of sync with the server.
2005-01-09 01:32:32 +00:00
yamt 68c071389c nfs_lookup: check n_nctime for positive entries as well to improve
cache consistency.
2005-01-08 03:12:30 +00:00
yamt f80647ef1e nfs_loadattrcache: invalidate access cache when ctime is changed. 2005-01-06 11:52:44 +00:00
thorpej 1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +00:00
yamt f4221aaaf6 revive spec vop_bwrite as it's needed for block devices.
PR/28684 from Jukka Salmi.
2004-12-17 03:31:20 +00:00
yamt ee344f939f redirect some VOPs which shouldn't be used for nfs
to genfs_badop (ie. panic).
2004-12-14 09:15:23 +00:00
yamt e3ed5def47 - centerize code to invalidate stale cache.
- don't ignore errors when invalidating buffers in nfs_open.
2004-12-14 09:13:13 +00:00
bouyer 0f82537ed4 The macro used for static server address is NFS_BOOTSTATIC_SERVADDR, not
NFS_BOOTSTATIC_SADDR. From Xen source distribution.
XXX NFS_BOOTSTATIC* doesn't seem to be documented anywhere ...
2004-12-12 16:24:14 +00:00
yamt 8cd5f554ba nfsrv_commit: make cnt unsigned so that very large commit requests can be
handled properly.
2004-12-09 02:18:45 +00:00
yamt 2bc7120ab8 when calling create-type VOP, make sure that va_mode is set
even when a client doesn't specify it.
(most filesystems get confused if va_mode is VNOVAL.)
2004-12-09 01:48:22 +00:00
yamt f11ea18093 nfsrv_read: fall back to copying when fail to loan pages.
(i forgot to commit this with uvm_loan.c rev.1.51.)
2004-12-04 08:07:52 +00:00
yamt a9fa9f0745 since daddr_t is 64-bit these days, simply use nfs directory cookies
as buffer cache indexes.  regress/sys/fs/getdents is now supposed to work.
fix PR/27112.
2004-10-26 04:34:46 +00:00
yamt 20a0770136 remove #if 0'ed out definition of VA_EXCLUSIVE. 2004-10-26 00:58:54 +00:00
yamt 3d250e0476 remove an unused macro, NMOD. 2004-10-26 00:27:07 +00:00
yamt 94223b8ff0 nfs_enterdircache: initialize dc_flags of a newly allocated dircache entry.
provided by Greg Oster.
2004-10-03 10:51:28 +00:00
yamt 31c025d90c nfs_readdirrpc, nfs_readdirplusrpc:
don't expose kernel garbage data to userland.
2004-10-03 10:17:33 +00:00
yamt 6b8cd53946 nfs_writerpc: fix PHOLD leak on error. 2004-10-01 01:08:01 +00:00
yamt 77b63b73b8 g/c NFSMINOFF, which is unused and identical with MRESETDATA. 2004-09-29 11:24:28 +00:00
yamt ac65f2420a nfs_readdirplusrpc: fix spurious EBUSYs. 2004-09-23 10:46:44 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
yamt e11d5e7c46 fix access-after-free bugs in dircache code by refcounting nfsdircache.
PR/26864.
2004-09-15 09:50:56 +00:00
yamt 4fd5a025bf nfs_request: a workaround for servers doing "maproot".
for i/o requests which are expected not to fail due to permission
to mimic unix file open semantics (READ, WRITE, COMMIT),
try two credentials.  namely, the file owner's one and open time one.
remember which credential worked in per-file basis and try it first
next time to minimize number of retries.
ideas from Chuck Silvers.  PR/23716 and PR/24987.
2004-08-24 20:09:44 +00:00
yamt bee0b74932 remove a "proc botch" debug printf. ok'ed by Jonathan Stone. 2004-08-18 23:44:47 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00
yamt 7653f67dd6 nfs_readdirplusrpc: fix a very long-standing cache corruption bug.
in the case of !bigenough, don't fill d_type or dnlc with bogus data.
2004-07-20 22:02:21 +00:00
yamt 62190652f1 revert nfs_vnops.c rev.1.189.
it's no longer needed because cache_enter() has been changed to handle
duplicated entries by itsself.
2004-07-20 22:00:29 +00:00
yamt e9bca9a46e nfs_doio_read: on short read, zero out the rest of the buffer unconditionally.
we can't rely on n_size here because it can be changed under us.
2004-07-18 07:43:00 +00:00
yamt 1c77f27a7a nfs_commit: use NAC_NOTRUNC when loading an attribute
as we're called holding pages locked.
2004-07-18 07:41:42 +00:00
yamt 72afe94686 nfs_fsinfo: when changing rsize/wsize,
keep mnt_fs_bshift in-sync.  otherwise genfs_getpages behaves badly.
2004-07-12 12:40:30 +00:00
yamt 0f5d997ee9 - include opt_inet.h for INET.
- catchup to in_ifaddr -> in_ifaddrhead rename.

XXX the address on the top of in_ifaddrhead is likely 127.0.0.1.
using it to construct the verifier doesn't make much sense.
maybe it's better to use some uuid or ip_randomid-like method.
2004-07-08 11:21:35 +00:00
yamt fad58613ba nfs_create: after an exclusive create rpc, make sure to update
timestamps, which were likely used to store the verifier.
reported by Mark Davies.  PR/26200
2004-07-08 11:12:14 +00:00
pk a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
yamt 21ae434eb2 nfs_lookup: use cache_lookup_raw() so that:
- "intrusive" dirops now have more chances to get benefits from dnlc.
- fixes a deadlock due to vnode locking order inversion.

nfs_create and others: purge stale dnlc entries
as nfs_lookup() no longer does it automatically.
2004-06-27 08:53:03 +00:00
jonathan 5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
yamt 3e209dd94a nfs_lookup: maintain PDIRUNLOCK even in the case of success to make
layered filesystems happy.
2004-06-16 23:55:30 +00:00
yamt ad338b9eff nfs_searchdircache: fix a null dereference in the case that
offset!=0 and dircache hasn't been initialized yet.
2004-06-14 12:28:35 +00:00
yamt e3b58482fb nfs_doio_read: use np->n_rcred instead of curproc->p_ucred for VDIR.
XXX maybe it's better to use a cred passed by VOP_READDIR.
2004-06-11 12:26:31 +00:00
yamt 03db65e256 make sure that nfssvc sockets are zapped before being freed. 2004-06-10 12:59:57 +00:00
yamt b0ac3e4201 nfsrv_zapsock: fix an inverted condition in nfs_syscall.c rev.1.74. 2004-06-10 12:57:43 +00:00
yamt 7407c491c3 nfsrv_create: fix an LP64 problem for exclusive create. 2004-05-31 08:47:08 +00:00
yamt ee306471a7 remove an unused instance of VOP_UPDATE. 2004-05-27 12:55:07 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 53c625655c Sysctl descriptions under vfs subtree 2004-05-25 04:44:43 +00:00
jonathan 20f923718e Change DIAGNOSTIC warning in nfs_send() about NULL rep->r_procp: the
warning is triggered pervasively, so print it only once per boot.
(The callers who pass NULL r_procps should soon be fixed to pass a
valid struct proc* ).
2004-05-24 19:08:07 +00:00
yamt 345a3c375d - for tcp, use SO_RCVTIMEO to recover from server crash.
otherwise we can be stuck in soreceive forever.
  the problem is pointed by Minoura Makoto.  PR/25662
- clear r_rexmit on reconnect and clear r_rtt and R_TIMING on retransmit
  so that the above (and soft mounts) happy.
2004-05-23 08:08:48 +00:00
christos 45fb41a2bd cut down another 7K by more NFS_V2_ONLY ifdefs. 2004-05-23 05:53:01 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
yamt 7a6774551d enable reply cache for connection oriented protocols as well.
linux retransmits rpcs even when using tcp.
2004-05-21 13:53:40 +00:00