History log of /dragonfly/sys/vfs/nfs/nfs_vnops.c (Results 1 – 25 of 143)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.2.1, v6.2.0, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0
# 178d5f37 24-Feb-2020 Matthew Dillon <dillon@apollo.backplane.com>

nfs - Strip out cr_prison from cached creds

* Strip out cr_prison from creds cached in struct nfs_node to
prevent exited jails from sticking around indefinitely.


Revision tags: v5.9.0, v5.8.0rc1, v5.6.3
# 13dd34d8 18-Oct-2019 zrj <rimvydas.jasinskas@gmail.com>

kernel: Cleanup <sys/uio.h> issues.

The iovec_free() inline very complicates this header inclusion. The
NULL check is not always seen from <sys/_null.h>. Luckily only three
kernel sources needs

kernel: Cleanup <sys/uio.h> issues.

The iovec_free() inline very complicates this header inclusion. The
NULL check is not always seen from <sys/_null.h>. Luckily only three
kernel sources needs it: kern_subr.c, sys_generic.c and uipc_syscalls.c.
Also just a single dev/drm source makes use of 'struct uio'.
* Include <sys/uio.h> explicitly first in drm_fops.c to avoid kfree()
macro override in drm compat layer.
* Use <sys/_uio.h> where only enums and struct uio is needed, but ensure
that userland will not include it for possible later <sys/user.h> use.
* Stop using <sys/vnode.h> as shortcut for uiomove*() prototypes. The
uiomove*() family functions possibly transfer data across kernel/user
space boundary. This header presence explicitly mark sources as such.
* Prefer to add <sys/uio.h> after <sys/systm.h>, but before <sys/proc.h>
and definitely before <sys/malloc.h> (except for 3 mentioned sources).
This will allow to remove <sys/malloc.h> from <sys/uio.h> later on.
* Adjust <sys/user.h> to use component headers instead of <sys/uio.h>.

While there, use opportunity for a minimal whitespace cleanup.

No functional differences observed in compiler intermediates.

show more ...


# c2c4c8a8 14-Sep-2019 Matthew Dillon <dillon@apollo.backplane.com>

nfs - Fix utimes() bugs in NFS

* Over the years I have tried very hard to avoid flushing pending writes
when issuing [l]utimes() operations (i.e. setattr VOPs) in NFS, but
it just causes issues

nfs - Fix utimes() bugs in NFS

* Over the years I have tried very hard to avoid flushing pending writes
when issuing [l]utimes() operations (i.e. setattr VOPs) in NFS, but
it just causes issues every time.

* Give up. We now flush pending writes prior to setattr() operations which
adjust mtime. This will slow down certain operations such as cp -Rp,
cpdup, etc, but should improve the consistency and reliability of
timestamps.

show more ...


Revision tags: v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2
# b56a444b 01-Apr-2019 Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

sys/vfs: Remove .vop_mmap implementations

These either return EINVAL or panic.
VOP_MMAP() is unused in the first place.

(FreeBSD got rid of VOP_MMAP() entirely in 2000.)
--
commit 1afa7eea2714a80f7

sys/vfs: Remove .vop_mmap implementations

These either return EINVAL or panic.
VOP_MMAP() is unused in the first place.

(FreeBSD got rid of VOP_MMAP() entirely in 2000.)
--
commit 1afa7eea2714a80f7f460a084f2dd793df48a236
Author: eivind <eivind@FreeBSD.org>
Date: Wed Nov 1 17:57:24 2000 +0000

Give vop_mmap an untimely death. The opportunity to give it a timely
death timed out in 1996.

show more ...


# fcf6efef 02-Mar-2019 Sascha Wildner <saw@online.de>

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them agai

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them again for where crit_*() are
no longer used.

I had to adjust some files that were relying on thread2.h
or headers that it includes coming in via other headers
that it was removed from.

show more ...


Revision tags: v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1
# 3b6a19b2 24-Oct-2017 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Refactor lockmgr()

* Seriously refactor lockmgr() so we can use atomic_fetchadd_*() for
shared locks and reduce unnecessary atomic ops and atomic op loops.

The main win here is being a

kernel - Refactor lockmgr()

* Seriously refactor lockmgr() so we can use atomic_fetchadd_*() for
shared locks and reduce unnecessary atomic ops and atomic op loops.

The main win here is being able to use atomic_fetchadd_*() when
acquiring and releasing shared locks. A simple fstat() loop (which
utilizes a LK_SHARED lockmgr lock on the vnode) improves from 191ns
to around 110ns per loop with 32 concurrent threads (on a 16-core/
32-thread xeon).

* To accomplish this, the 32-bit lk_count field becomes 64-bits. The
shared count is separated into the high 32-bits, allowing it to be
manipulated for both blocking shared requests and the shared lock
count field. The low count bits are used for exclusive locks.
Control bits are adjusted to manage lockmgr features.

LKC_SHARED Indicates shared lock count is active, else excl lock
count. Can predispose the lock when the related count
is 0 (does not have to be cleared, for example).

LKC_UPREQ Queued upgrade request. Automatically granted by
releasing entity (UPREQ -> ~SHARED|1).

LKC_EXREQ Queued exclusive request (only when lock held shared).
Automatically granted by releasing entity
(EXREQ -> ~SHARED|1).

LKC_EXREQ2 Aggregated exclusive request. When EXREQ cannot be
obtained due to the lock being held exclusively or
EXREQ already being queued, EXREQ2 is flagged for
wakeup/retries.

LKC_CANCEL Cancel API support

LKC_SMASK Shared lock count mask (LKC_SCOUNT increments).

LKC_XMASK Exclusive lock count mask (+1 increments)

The 'no lock' condition occurs when LKC_XMASK is 0 and LKC_SMASK is
0, regardless of the state of LKC_SHARED.

* Lockmgr still supports exclusive priority over shared locks. The
semantics have slightly changed. The priority mechanism only applies
to the EXREQ holder. Once an exclusive lock is obtained, any blocking
shared or exclusive locks will have equal priority until the exclusive
lock is released. Once released, shared locks can squeeze in, but
then the next pending exclusive lock will assert its priority over
any new shared locks when it wakes up and loops.

This isn't quite what I wanted, but it seems to work quite well. I
had to make a trade-off in the EXREQ lock-grant mechanism to improve
performance.

* In addition, we use atomic_fcmpset_long() instead of
atomic_cmpset_long() to reduce cache line flip flopping at least
a little.

* Remove lockcount() and lockcountnb(), which tried to count lock refs.
Replace with lockinuse(), which simply tells the caller whether the
lock is referenced or not.

* Expand some of the copyright notices (years and authors) for major
rewrites. Really there are a lot more and I have to pay more attention
to adjustments.

show more ...


Revision tags: v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1
# 7adf09fa 27-Sep-2017 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Fix unnecessary ucred duplication

* Fix unnecessary ucred replication. This is not a memory leak, but it
is annoying.

* Replicated ucreds can build-up in the system (up to maxvnodes) du

kernel - Fix unnecessary ucred duplication

* Fix unnecessary ucred replication. This is not a memory leak, but it
is annoying.

* Replicated ucreds can build-up in the system (up to maxvnodes) due to
to unlinked files.

* Fix by flagging unlinked files in np->n_flag and immediately recycling
the related vnode in the inactive code if it has been flagged for
removal.

show more ...


Revision tags: v4.8.1, v4.8.0, v4.6.2, v4.9.0, v4.8.0rc
# 85e11dad 22-Jan-2017 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Fix NFS sillyrename code

* Due to the delayed vnode reclamation changes done several years ago
the NFS client code was not properly removing silly-renamed files
on last-close (these are

kernel - Fix NFS sillyrename code

* Due to the delayed vnode reclamation changes done several years ago
the NFS client code was not properly removing silly-renamed files
on last-close (these are files which NFS renames to .nfs* when
remove()'d while still open()).

* Fixed by flagging finalization on last-close if a sillyrename occurs.

show more ...


Revision tags: v4.6.1, v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3
# 05c073d6 18-Feb-2016 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Add kqueue support to NFS (fix firefox issues w/nfs)

* Firefox appears to get semi-random memory corruption and otherwise
implodes if one or more filesystems it accesses does not support

kernel - Add kqueue support to NFS (fix firefox issues w/nfs)

* Firefox appears to get semi-random memory corruption and otherwise
implodes if one or more filesystems it accesses does not support
kqueue. This appears to be due to some interaction between
firefox, glib, and the kernel when kqueue support is missing
from a filesystem.

* Add host-local kqueue support to NFS. As with locks, the support
is host-local only and will not work across multiple clients
sharing the same files.

* Appears to stabilize firefox when file(s) it accesses are on
NFS.

show more ...


Revision tags: v4.4.2, v4.4.1, v4.4.0, v4.5.0, v4.4.0rc, v4.2.4, v4.3.1, v4.2.3, v4.2.1, v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5, v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0, v3.8.2
# 966299f6 18-Jul-2014 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Fix two NFS crashes

* Fix a bug during unmount when sillyrenames are being terminated.
When doing a forced unmount, the sillyrename vnode(s) may be VBAD.
Do not attempt to flush the sil

kernel - Fix two NFS crashes

* Fix a bug during unmount when sillyrenames are being terminated.
When doing a forced unmount, the sillyrename vnode(s) may be VBAD.
Do not attempt to flush the sillyrename in this case.

* Fix a bug for 'soft' mounts. Soft failures do not properly set the
error code which can lead to a NULL pointer dereference in the rpc
processing code.

Set the error code to EINTR for soft mounts whos retries have been
exceeded.

show more ...


Revision tags: v3.8.1, v3.6.3
# 1013402d 08-Jun-2014 Sascha Wildner <saw@online.de>

kernel: Add a number of missing crit_exit, lwkt_reltoken, rel_mplock, etc.


Revision tags: v3.8.0, v3.8.0rc2, v3.9.0, v3.8.0rc, v3.6.2, v3.6.1, v3.6.0
# b458d1ab 14-Nov-2013 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Performance tuning (3)

* The VOP_CLOSE issues revealed a bigger issue with vn_lock(). Many
callers do not check the return code for vn_lock() and in nearly all
of those cases it wouldn

kernel - Performance tuning (3)

* The VOP_CLOSE issues revealed a bigger issue with vn_lock(). Many
callers do not check the return code for vn_lock() and in nearly all
of those cases it wouldn't fail anyway due to a prior ref, but it
creates an API issue.

* Add the LK_FAILRECLAIM flag to vn_lock(). This flag explicitly allows
vn_lock() to fail if the vnode is undergoing reclamation.

This fixes numerous issues, particularly when VOP_CLOSE() is called
during a reclaim due to recent LK_UPGRADE's that we do in some VFS
*_close() functions.

* Remove some unused LK_ defines.

show more ...


# 12cdc371 09-Nov-2013 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Performance tuning

* Use a shared lock in the exec*() code, open, close, chdir, fchdir,
access, stat, and readlink.

* Adjust nlookup() to allow the last namecache record in a path to be

kernel - Performance tuning

* Use a shared lock in the exec*() code, open, close, chdir, fchdir,
access, stat, and readlink.

* Adjust nlookup() to allow the last namecache record in a path to be
locked shared if it is already resolved, and the caller requests it.

* Remove nearly all global locks from critical dsched paths. Defer
creation of the tdio until an I/O actually occurs (huge savings in
the fork/exit paths).

* Improves fork/exec concurrency on monster of static binaries from
14200/sec to 55000/sec+. For dynamic binaries improve from around
2500/sec to 9000/sec or so (48 cores fork/exec'ing different dynamic
binaries). For the same dynamic binary it's more around 5000/sec or
so.

Lots of issues here including the fact that all dynamic binaries load
many shared resources, even hen the binaries are different programs.
AKA libc.so.X and ld-elf.so.2, as well as /dev/urandom (from libc),
and access numerous common path elements.

Nearly all of these paths are now non-contending. The major remaining
contention is in per-vm_page/PMAP manipulation. This is per-page and
concurrent execs of the same program tend to pipeline so it isn't a
big problem.

show more ...


Revision tags: v3.7.1, v3.6.0rc, v3.7.0
# ee173d09 20-Oct-2013 Sascha Wildner <saw@online.de>

kernel - Rewrite vnode ref-counting code to improve performance

* Rewrite the vnode ref-counting code and modify operation to not
immediately VOP_INACTIVE a vnode when its refs drops to 0. By
d

kernel - Rewrite vnode ref-counting code to improve performance

* Rewrite the vnode ref-counting code and modify operation to not
immediately VOP_INACTIVE a vnode when its refs drops to 0. By
doing so we avoid cycling vnodes through exclusive locks when
temporarily accessing them (such as in a path lookup). Shared
locks can be used throughout.

* Track active/inactive vnodes a bit differently, keep track of
the number of vnodes that are still active but have zero refs,
and rewrite the vnode freeing code to use the new statistics
to deactivate cached vnodes.

show more ...


# fd2da346 11-Oct-2013 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Optimize sync and msync for tmpfs and nfs

* Flesh-out the vfs_sync API and implement vhold/vdrop callbacks
(used by NFS).

* Use MNTK_THR_SYNC in tmpfs and finish implementing it in nfs.

kernel - Optimize sync and msync for tmpfs and nfs

* Flesh-out the vfs_sync API and implement vhold/vdrop callbacks
(used by NFS).

* Use MNTK_THR_SYNC in tmpfs and finish implementing it in nfs. This
will optimize sync and msync for these filesystems.

* In both cases inode attributes are either synchronous or don't involve
any VFS work to flush, so we don't have to use VISDIRTY.

show more ...


Revision tags: v3.4.3
# dc71b7ab 31-May-2013 Justin C. Sherrill <justin@shiningsilence.com>

Correct BSD License clause numbering from 1-2-4 to 1-2-3.

Apparently everyone's doing it:
http://svnweb.freebsd.org/base?view=revision&revision=251069

Submitted-by: "Eitan Adler" <lists at eitanadl

Correct BSD License clause numbering from 1-2-4 to 1-2-3.

Apparently everyone's doing it:
http://svnweb.freebsd.org/base?view=revision&revision=251069

Submitted-by: "Eitan Adler" <lists at eitanadler.com>

show more ...


Revision tags: v3.4.2
# 2702099d 06-May-2013 Justin C. Sherrill <justin@shiningsilence.com>

Remove advertising clause from all that isn't contrib or userland bin.

By: Eitan Adler <lists@eitanadler.com>


Revision tags: v3.4.0, v3.4.1, v3.4.0rc, v3.5.0
# 1d0de3d3 08-Jan-2013 Sascha Wildner <saw@online.de>

kernel/vfs: Remove some unused variables.


Revision tags: v3.2.2
# c9682b51 21-Nov-2012 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Fix NFS panic when competing clients collide on hardlink

* Fix recursive execlusive lock on vnode.

* For example, if several boxes are nfs booting and have the same writable
/var/log, si

kernel - Fix NFS panic when competing clients collide on hardlink

* Fix recursive execlusive lock on vnode.

* For example, if several boxes are nfs booting and have the same writable
/var/log, simultanious attempts to rotate logs can cause a panic due to
higher layers of the OS's hardlink code not being able to detect
duplicate vnodes which are created by some other client racing the same
operation.

* Adds CNP_NOTVP and cn_notvp flag which vop_compat_nlink() uses to notify
NFS's VOP_LOOKUP function to check for a vnode lookup collision.

-Matt

show more ...


Revision tags: v3.2.1, v3.2.0, v3.3.0, v3.0.3, v3.0.2, v3.0.1, v3.1.0, v3.0.0
# 884717e1 06-Dec-2011 Sascha Wildner <saw@online.de>

kernel: Replace all usage of MALLOC()/FREE() with kmalloc()/kfree().


# 86d7f5d3 26-Nov-2011 John Marino <draco@marino.st>

Initial import of binutils 2.22 on the new vendor branch

Future versions of binutils will also reside on this branch rather
than continuing to create new binutils branches for each new version.


Revision tags: v2.12.0, v2.13.0, v2.10.1, v2.11.0, v2.10.0, v2.9.1, v2.8.2, v2.8.1, v2.8.0, v2.9.0, v2.6.3, v2.7.3, v2.6.2, v2.7.2, v2.7.1, v2.6.1, v2.7.0, v2.6.0, v2.5.1, v2.4.1, v2.5.0, v2.4.0
# 40822939 09-Sep-2009 Nicolas Thery <nthery@gmail.com>

nfs: fix real/effective id mismatch in nfs_access

When access(2) or faccessat(2) without AT_EACCESS are called on
NFS file, use real uid/gid.

When faccessat(2) with AT_EACCESS set is called on NFS

nfs: fix real/effective id mismatch in nfs_access

When access(2) or faccessat(2) without AT_EACCESS are called on
NFS file, use real uid/gid.

When faccessat(2) with AT_EACCESS set is called on NFS file, use
effective uid/gid.

show more ...


# a63246d1 28-Aug-2009 Matthew Dillon <dillon@apollo.backplane.com>

NFS - Fix remaining VM/BIO issues

The only bug that could not be resolved by the previous commit is related
to the use of dynamic buffer sizing for the buffer that straddles the
EOF of the file. Fo

NFS - Fix remaining VM/BIO issues

The only bug that could not be resolved by the previous commit is related
to the use of dynamic buffer sizing for the buffer that straddles the
EOF of the file. For example, if a file is 32768+4127 bytes then the
second buffer cache buffer would have a size of 4127 bytes instead of
32768 bytes. Because the EOF point can move around and NFS does not
keep good track of it buffers with weird sizes could build up in the
system and interfere with operations against backing VM pages.

In particular truncations followed by seek-write extensions would
interfere with mmap()'s areas around the original (now non-applicable)
truncation point.

It was not possible to fix this bug while still keeping the dynamic
buffer sizing, so this patch converts NFS's buffer cache operations
to use fixed-sized buffers in all cases. This leads to more wasted
memory when dealing with small files and further optimizations may be
attempted in the future, but it seems to solve issues with BIO/VM
interactions.

* Fsx now survives an overnight pass.

* Buildworld now survives multiple passes when using a writable NFS /usr/obj.

* Fix umount sequencing. Sometimes the rxthread would get into a
reconnect loop and not exit.

show more ...


# cb1cf930 28-Aug-2009 Matthew Dillon <dillon@apollo.backplane.com>

Kernel - Close VM/BIO races and document.o

* Remove vfs_setdirty(), it is no longer used.
Remove vfs_page_set_valid(), it is no longer used.
Remove vfs_bio_set_valid(), it is no longer used.

*

Kernel - Close VM/BIO races and document.o

* Remove vfs_setdirty(), it is no longer used.
Remove vfs_page_set_valid(), it is no longer used.
Remove vfs_bio_set_valid(), it is no longer used.

* When acquiring a buffer with getblk() whos size differs from the
buffer already cached, no longer destroy the VM pages backing
the buffer after completing the write. Instead just release
the buffer so a new, larger one can be constructed.

NFS buffers which straddle file EOF can remain cached after the
file has been extended via seek/write or ftruncate, and their
underlying VM pages may become dirty via mmap. If the buffer
is acquired later the underlying VM pages beyond the buffer's
original b_bcount size must be retained, not destroyed.

* No longer try to clear the pmap modified bit from misc vm_page_*()
functions. In cases where we desire the pmap modified bit to be
clear, it should *already* have been cleared in the run-up to the
I/O. Clearing it later may cause the buffer cache to lose track
of the fact that underlying VM pages may have been modified again.

NFS buffers use b_dirtyoff/b_dirtyend to determine what to actually
write. If the VM page is modified again the current write operation
will not cover all the dirty parts of the buffer and another write
will have to be issued. Clearing the pmap modified bit at later
stages did not properly track changes in b_dirtyoff/b_dirtyend and
resulted in dirty data being lost.

* Implement vfs_clean_one_page() to deal with nearly all buffer cache vs
backing VM page dirty->clean handling at the appropriate time.

In addition, this function now detects the case where a buffer has
B_NEEDCOMMIT set but the underlying VM page is dirty. This
function necessarily only clears the dirty bits associated
with the buffer because buffer sizes are not necessarily page aligned,
which is different from clearing ALL the dirty bits as the putpages
code is able to do. So the B_NEEDCOMMIT test is only against those
dirty bits associated with the buffer. If this is found to be the
case the B_NEEDCOMMIT flag is cleared.

This fixes a race where VM pages backing a dirty buffer which has gone
through the phase-1 commit are dirtied via a mmap, and NFS then goes
through with the phase-2 commit and throws the data away when it really
needed to go back and do another phase-1 commit.

* In vnode_generic_put_pages() no longer clear the VM page dirty bits
associated with bits of a file which extend past file EOF in the
page straddling the EOF. We used to do this with the idea that
we would only clear the dirty bits up to the file EOF later on
in the I/O completion code.

However, this was too fragile. If a page ended up with any dirty
bits left set it would remain endless dirty and be reflushed forever.

We now clear the dirty bits for the entire page after a putpages
operation completes without error, and don't bother doing it
prior to I/O initiation.

* Call nfs_meta_setsize() for both seek+write extensions (holes) and for
ftruncate extensions (holes).

nfs_meta_setsize() now deterministically adjusts the size of the buffer
that was straddling the PRIOR EOF point, fixing an issue where
write-extending a file to near the end of a nfs buffer boundary (32K),
then seek-write extending it further by creating a hole, then
mmap()ing the end of the first chunk and modifying data past the
original write-extend point... would lose the extra data because
the original buffer was still intact and was still sized for the
original EOF. This was difficult to reproduce because it only occurred
if all the dirty bits got cleared when the original buffer is flushed,
meaning the original write-extend point had to be within 511 bytes of
the end of a 32K boundary.

show more ...


# 28953d39 24-Aug-2009 Matthew Dillon <dillon@apollo.backplane.com>

NFS - Properly handle NFSv3 EOF short-reads

* Short reads were not causing the remainder of the buffer to be
zero'd out in all cases, causing the fsx filesystem test to fail.

* An EOF condition w

NFS - Properly handle NFSv3 EOF short-reads

* Short reads were not causing the remainder of the buffer to be
zero'd out in all cases, causing the fsx filesystem test to fail.

* An EOF condition was sometimes improperly reporting a non-zero
bp->b_resid. Race against the server where the client's idea of
the file size differs from the server could result in a non-zero
bp->b_resid after a BIO.

Zero out the remaining space and and set bp->b_resid to 0. The
NFS client code always specifies buffers within the bounds of
the file.

Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>

show more ...


123456