Commit graph

4525 commits

Author SHA1 Message Date
Rick Macklem
9ec7dbf46b nfscl: Add a Linux compatible "nconnect" mount option
Linux has had an "nconnect" NFS mount option for some time.
It specifies that N (up to 16) TCP connections are to created for a mount,
instead of just one TCP connection.

A discussion on freebsd-net@ indicated that this could improve
client<-->server network bandwidth, if either the client or server
have one of the following:
- multiple network ports aggregated to-gether with lagg/lacp.
- a fast NIC that is using multiple queues
It does result in using more IP port#s and might increase server
peak load for a client.

One difference from the Linux implementation is that this implementation
uses the first TCP connection for all RPCs composed of small messages
and uses the additional TCP connections for RPCs that normally have
large messages (Read/Readdir/Write).  The Linux implementation spreads
all RPCs across all TCP connections in a round robin fashion, whereas
this implementation spreads Read/Readdir/Write across the additional
TCP connections in a round robin fashion.

(cherry picked from commit 1e0a518d65)
2021-08-03 16:40:47 -07:00
Konstantin Belousov
7f5a4aff9b nullfs: provide custom null_rename bypass
(cherry picked from commit 4eaf9609fe)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
5c52335fd1 null_rename: some style
(cherry picked from commit 26e72728ce)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
2a56a5c2c2 fifofs: fifo vnode might be relocked before VOP_OPEN() is called
(cherry picked from commit 10db189649)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
a3c7e571c0 null_lookup: restore dvp lock always, not only on success
(cherry picked from commit 4f21442e10)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
0a4eb4d65c null_bypass(): prevent loosing the only reference to the lower vnode
(cherry picked from commit d5b078163e)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
b5eaf00527 nullfs: provide custom null_advlock bypass
(cherry picked from commit 161e9a9736)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
75e8553e79 null_bypass(): some style
(cherry picked from commit 7b7227c4a6)
2021-08-03 12:52:35 +03:00
Mark Johnston
f9d3c6f4b5 nfsclient: Avoid copying uninitialized bytes into statfs
hst will be nul-terminated but the remaining space in the buffer is left
uninitialized.  Avoid copying the entire buffer to ensure that
uninitialized bytes are not leaked via statfs(2).

Reported by:	KMSAN
Reviewed by:	rmacklem
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 44de1834b5)
2021-07-29 08:11:16 -04:00
Alan Somers
c7fe00ae40 fusefs: correctly set lock owner during FUSE_SETLK
During FUSE_SETLK, the owner field should uniquely identify the calling
process.  The fusefs module now sets it to the process's pid.
Previously, it expected the calling process to set it directly, which
was wrong.

libfuse also apparently expects the owner field to be set during
FUSE_GETLK, though I'm not sure why.

PR:		256005
Reported by:	Agata <chogata@moosefs.pro>
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D30622

(cherry picked from commit 18b19f8c6e)
2021-07-27 11:44:28 -06:00
Mark Johnston
b88a1996e2 fifo: Explicitly initialize generation numbers when opening
The fi_rgen and fi_wgen fields are generation numbers used when sleeping
waiting for the other end of the fifo to be opened.  The fields were not
explicitly initialized after allocation, but this was harmless.  To
avoid false positives from KMSAN, though, ensure that they get
initialized to zero.

Reported by:	KMSAN
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b9ca419a21)
2021-07-26 21:46:45 -04:00
Rick Macklem
8e24b25b67 nfscl: Avoid KASSERT() panic in cache_enter_time()
Commit 844aa31c6d added cache_enter_time_flags(), specifically
so that the NFS client could specify that cache enter replace
any stale entry for the same name.  Doing so avoids a KASSERT()
panic() in cache_enter_time(), as reported by the PR.

This patch uses cache_enter_time_flags() for Readdirplus, to
avoid the panic(), since it is impossible for the NFS client
to know if another client (or a local process on the NFS server)
has replaced a file with another file of the same name.

This patch only affects NFS mounts that use the "rdirplus"
mount option.

There may be other places in the NFS client where this needs
to be done, but no panic() has been observed during testing.

PR:	257043

(cherry picked from commit 7f5508fe78)
2021-07-25 14:45:05 -07:00
Mark Johnston
51095d36de nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set
Reported by:	KMSAN
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7a9bc8a82e)
2021-07-23 07:49:31 -04:00
Rick Macklem
cd2e5ae71b nfscl: Improve "Consider increasing kern.ipc.maxsockbuf" message
When the setting of kern.ipc.maxsockbuf is less than what is
desired for I/O based on vfs.maxbcachebuf and vfs.nfs.bufpackets,
a console message of "Consider increasing kern.ipc.maxsockbuf".
is printed.

This patch modifies the message to provide a suggested value
for kern.ipc.maxsockbuf.
Note that the setting is only needed when the NFS rsize/wsize
is set to vfs.maxbcachebuf.

While here, make nfs_bufpackets global, so that it can be used
by a future patch that adds a sysctl to set the NFS server's
maximum I/O size.  Also, remove "sizeof(u_int32_t)" from the maximum
packet length, since NFS_MAXXDR is already an "overestimate"
of the actual length.

(cherry picked from commit c5f4772c66)
2021-07-14 13:45:41 -07:00
Rick Macklem
8a04edfdcb nfscl: Change the default minor version for NFSv4 mounts
When NFSv4.1 support was added to the client, the implementation was
still experimental and, as such, the default minor version was set to 0.
Since the NFSv4.1 client implementation is now believed to be solid
and the NFSv4.1/4.2 protocol is significantly better than NFSv4.0,
I beieve that NFSv4.1/4.2 should be used where possible.

This patch changes the default minor version for NFSv4 to be the highest
minor version supported by the NFSv4 server. If a specific minor version
is desired, the "minorversion" mount option can be used to override
this default.  This is compatible with the Linux NFSv4 client behaviour.

This was discussed on freebsd-current@ in mid-May 2021 under
the subject "changing the default NFSv4 minor version" and
the consensus seemed to be support for this change.
It also appeared that changing this for FreeBSD 13.1 was
not considered a POLA violation, so long as UPDATING
and RELNOTES entries were made for it.

(cherry picked from commit a145cf3f73)
2021-07-11 15:26:55 -07:00
Konstantin Belousov
eee344ccd1 unionfs: do not use bare struct componentname
(cherry picked from commit 190110f2eb)
2021-07-07 13:23:30 +03:00
Alan Somers
27d5544166 fusefs: ensure that FUSE ops' headers' unique values are actually unique
Every FUSE operation has a unique value in its header.  As the name
implies, these values are supposed to be unique among all outstanding
operations.  And since FUSE_INTERRUPT is asynchronous and racy, it is
desirable that the unique values be unique among all operations that are
"close in time".

Ensure that they are actually unique by incrementing them whenever we
reuse a fuse_dispatcher object, for example during fsync, write, and
listextattr.

PR:		244686
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D30810

(cherry picked from commit 5403f2c163)
2021-07-03 18:05:13 -06:00
Alan Somers
beeaeb6cc5 fusefs: delete dead code
It was always dead, accidentally included in SVN r345876.

Reviewed by:	pfg

(cherry picked from commit b97c7abc1a)
2021-07-03 17:59:54 -06:00
Alan Somers
7b096a997f fusefs: support EVFILT_WRITE on /dev/fuse
/dev/fuse is always ready for writing, so it's kind of dumb to poll it.
But some applications do it anyway.  Better to return ready than EINVAL.

Reviewed by:	emaste, pfg
Differential Revision: https://reviews.freebsd.org/D30784

(cherry picked from commit 7b8622fa22)

Simplify fuse_device_filt_write

It always returns 1, so why bother having a variable.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/478

(cherry picked from commit 9b876fbd50)
2021-07-03 17:57:51 -06:00
Alan Somers
cc5020854d fusefs: improve warnings about buggy FUSE servers
The fusefs driver will print warning messages about FUSE servers that
commit protocol violations.  Previously it would print those warnings on
every violation, but that could spam the console.  Now it will print
each warning no more than once per lifetime of the mount.  There is also
now a dtrace probe for each violation.

Sponsored by:	Axcient
Reviewed by:	emaste, pfg
Differential Revision: https://reviews.freebsd.org/D30780

(cherry picked from commit 0b9a5c6fa1)
2021-07-03 17:53:58 -06:00
Alan Somers
39b5d593b7 fusefs: delete dead code
Delete two fields in the per-mountpoint struct that have never been
used.

Sponsored by:	Axcient

(cherry picked from commit d63e6bc256)
2021-07-03 17:40:55 -06:00
Rick Macklem
a5b5a24d1a nfscl: Make NFSv4.0 client acquisition NFSv4.1/4.2 compatible
When the NFSv4.0 client was implemented, acquisition of a clientid
via SetClientID/SetClientIDConfirm was done upon the first Open,
since that was when it was needed.  NFSv4.1/4.2 acquires the clientid
during mount (via ExchangeID/CreateSession), since the associated
session is required during mount.

This patch modifies the NFSv4.0 mount so that it acquires the
clientid during mount.  This simplifies the code and makes it
easy to implement "find the highest minor version supported by
the NFSv4 server", which will be done for the default minorversion
in a future commit.
The "start_renewthread" argument for nfscl_getcl() is replaced
by "tryminvers", which will be used by the aforementioned
future commit.

(cherry picked from commit aed98fa5ac)
2021-06-29 18:15:35 -07:00
Rick Macklem
8410066787 krpc: Acquire ref count of CLIENT for backchannel use
Michael Dexter <editor@callfortesting.org> reported
a crash in FreeNAS, where the first argument to
clnt_bck_svccall() was no longer valid.
This argument is a pointer to the callback CLIENT
structure, which is free'd when the associated
NFSv4 ClientID is free'd.

This appears to have occurred because a callback
reply was still in the socket receive queue when
the CLIENT structure was free'd.

This patch acquires a reference count on the CLIENT
that is not CLNT_RELEASE()'d until the socket structure
is destroyed. This should guarantee that the CLIENT
structure is still valid when clnt_bck_svccall() is called.
It also adds a check for closed or closing to
clnt_bck_svccall() so that it will not process the callback
RPC reply message after the ClientID is free'd.

(cherry picked from commit e1a907a25c)
2021-06-26 16:03:41 -07:00
Rick Macklem
6c5dae287e nfscl: Add a "has acquired a delegation" flag for delegations
A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount.  Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

(cherry picked from commit 5e5ca4c8fc)
2021-06-26 16:01:09 -07:00
Rick Macklem
b1caf1920f nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

(cherry picked from commit 03c81af249)
2021-06-26 15:58:21 -07:00
Rick Macklem
6078d52fa1 nfsd: Fix NFSv4.1/4.2 Secinfo_no_name when security flavors empty
Commit 947bd2479b added support for the Secinfo_no_name operation.
When a non-exported file system is being traversed, the list of
security flavors is empty.  It turns out that the Linux client
mount attempt fails when the security flavors list in the
Secinfo_no_name reply is empty.

This patch modifies Secinfo/Secinfo_no_name so that it replies
with all four security flavors when the list is empty.
This fixes Linux NFSv4.1/4.2 mounts when the file system at
the NFSv4 root (as specified on a V4: exports(5) line) is
not exported.

(cherry picked from commit 56e9d8e38e)
2021-06-26 15:56:10 -07:00
Rick Macklem
9f581cbd5a nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients
Commit d224f05fcf pre-parsed the next operation number for
the put file handle operations.  This patch uses this next
operation number, plus the type of the file handle being set by
the put file handle operation, to implement the rules in RFC5661
Sec. 2.6 with respect to replying NFSERR_WRONGSEC.

This patch also adds a check to see if NFSERR_WRONGSEC should be
replied when about to perform Lookup, Lookupp or Open with a file
name component, so that the NFSERR_WRONGSEC reply is done for
these operations, as required by RFC5661 Sec. 2.6.

This patch does not have any practical effect for the FreeBSD NFSv4
client and I believe that the same is true for the Linux client,
since NFSERR_WRONGSEC is considered a fatal error at this time.

(cherry picked from commit a5df139ec6)
2021-06-26 15:52:30 -07:00
Rick Macklem
54ccbc9bb6 nfsd: Pre-parse the next NFSv4 operation number for put FH operations
RFC5661 Sec. 2.6 specifies when a NFSERR_WRONGSEC error reply can be done.
For the four operations PutFH, PutrootFH, PutpublicFH and RestoreFH,
NFSERR_WRONGSEC can or cannot be replied, depending upon what operation
follows one of these operations in the compound.

This patch modifies nfsrvd_compound() so that it parses the next operation
number before executing any of the above four operations, storing it in
"nextop".

A future commit will implement use of "nextop" to decide if NFSERR_WRONGSEC
can be replied for the above four operations.

This commit should not change the semantics of performing the compound RPC.

(cherry picked from commit d224f05fcf)
2021-06-26 15:50:16 -07:00
Rick Macklem
92500ec0c4 nfsd: Fix the failure return for non-fh NFSv4 operations
Without this patch, nfsd_checkrootexp() returns failure
and then the NFSv4 operation would reply NFSERR_WRONGSEC.
RFC5661 Sec. 2.6 only allows a few NFSv4 operations, none
of which call nfsv4_checktootexp(), to return NFSERR_WRONGSEC.
This patch modifies nfsd_checkrootexp() to return the
error instead of a boolean and sets the returned error to an RPC
layer AUTH_ERR, as discussed on nfsv4@ietf.org.
The patch also fixes nfsd_errmap() so that the pseudo
error NFSERR_AUTHERR is handled correctly such that an RPC layer
AUTH_ERR is replied to the NFSv4 client.

The two new "enum auth_stat" values have not yet been assigned
by IANA, but are the expected next two values.

The effect on extant NFSv4 clients of this change appears
limited to reporting a different failure error when a
mount that does not use adequate security is attempted.

(cherry picked from commit 984c71f903)
2021-06-26 15:46:18 -07:00
Rick Macklem
0da7999242 nfsd: Delete extraneous NFSv4 root checks
There are several NFSv4.1/4.2 server operation functions which
have unneeded checks for the NFSv4 root being set up.
The checks are not needed because the operations always follow
a Sequence operation, which performs the check.

This patch deletes these checks, simplifying the code so
that a future patch that fixes the checks to conform with
RFC5661 Sec. 2.6 will be less extension.

(cherry picked from commit 1d4afcaca2)
2021-06-26 15:43:49 -07:00
Rick Macklem
3747e3b28e nfsd: Add support for the NFSv4.1/4.2 Secinfo_no_name operation
The Linux client is now attempting to use the Secinfo_no_name
operation for NFSv4.1/4.2 mounts.  Although it does not seem to
mind the NFSERR_NOTSUPP reply, adding support for it seems
reasonable.

I also noticed that "savflag" needed to be 64bits in
nfsrvd_secinfo() since nd_flag in now 64bits, so I changed
the declaration of it there.  I also added code to set "vp" NULL
after performing Secinfo/Secinfo_no_name, since these
operations consume the current FH, which is represented
by "vp" in nfsrvd_compound().

Fixing when the server replies NFSERR_WRONGSEC so that
it conforms to RFC5661 Sec. 2.6 still needs to be done
in a future commit.

(cherry picked from commit 947bd2479b)
2021-06-26 15:40:07 -07:00
Rick Macklem
972883b9e0 nfscl: Use hash lists to improve expected search performance for opens
A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.  When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

Commit 3f7e14ad93 added a hash table of lists hashed on file handle
for the opens.  This patch uses the hash lists for searching for
a matching open based of file handle instead of an exhaustive
linear search of all opens.
This change appears to be performance neutral for a small number
of opens, but should improve expected performance for a large
number of opens.

This commit should not affect the high level semantics of open
handling.

(cherry picked from commit 96b40b8967)
2021-06-11 18:21:03 -07:00
Rick Macklem
624a723a95 nfscl: Use hash lists to improve expected search performance for opens
A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.  When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

Commit 3f7e14ad93 added a hash table of lists hashed on file handle
for the opens.  This patch uses the hash lists for searching for
a matching open based of file handle instead of an exhaustive
linear search of all opens.
This change appears to be performance neutral for a small number
of opens, but should improve expected performance for a large
number of opens.  This patch also moves any found match to the front
of the hash list, to try and maintain the hash lists in recently
used ordering (least recently used at the end of the list).

This commit should not affect the high level semantics of open
handling.

(cherry picked from commit 724072ab1d)
2021-06-11 18:19:13 -07:00
Konstantin Belousov
043f204985 fdescfs: add an option to return underlying file vnode on lookup
(cherry picked from commit f9b1e711f0)
2021-06-11 03:33:48 +03:00
Mateusz Guzik
4ece00cd40 tmpfs: save on relocking the allnode lock in tmpfs_free_node_locked
(cherry picked from commit f4aa64528e)
2021-06-07 00:34:59 +00:00
Mateusz Guzik
56687b27b8 tmpfs: save on common case relocking in tmpfs_reclaim
(cherry picked from commit 331a7601c9)
2021-06-07 00:34:59 +00:00
Mateusz Guzik
32e5616359 tmpfs: drop a redundant NULL check in tmpfs_alloc_vp
(cherry picked from commit 439d942b9e)
2021-06-07 00:34:58 +00:00
Mateusz Guzik
71622a3518 tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent
The id field is immutable until the node gets freed.

(cherry picked from commit 7fbeaf33b8)
2021-06-07 00:34:57 +00:00
Mateusz Guzik
997332f9cd ext2: add missing uio_td initialization to ext2_htree_append_block
Reported by:	pho

(cherry picked from commit 284cf3f18b)
2021-06-07 00:29:49 +00:00
Mateusz Guzik
033820ace7 nfs: even up value returned by nfsrv_parsename with copyinstr
Reported by:	dim
Reviewed by:	rmacklem

(cherry picked from commit 68c2544264)
2021-06-07 00:29:38 +00:00
Rick Macklem
4fee353bcb nfscl: Add hash lists for the NFSv4 opens
A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.  When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

This patch adds a table of hash lists for the opens, hashed on
file handle.  This table will be used by future commits to
search for an open based on file handle more efficiently.

(cherry picked from commit 3f7e14ad93)
2021-06-04 18:16:10 -07:00
Rick Macklem
b1461cdd30 nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open
Commit b3d4c70dc6 added support for CLAIM_DELEG_CUR_FH to Open.
While doing this, I noticed that CLAIM_DELEG_PREV_FH support
could be added the same way.  Although I am not aware of any extant
NFSv4.1/4.2 client that uses this claim type, it seems prudent to add
support for this variant of Open to the NFSv4.1/4.2 server.

This patch does not affect mounts from extant NFSv4.1/4.2 clients,
as far as I know.

(cherry picked from commit d80a903a1c)
2021-06-03 20:31:06 -07:00
Rick Macklem
4775325dd6 nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease
The most difficult NFSv4 client recovery case happens when the
lease has expired on the server.  For NFSv4.0, the client will
receive a NFSERR_EXPIRED reply from the server to indicate this
has happened.
For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such,
the client will receive a NFSERR_BADSESSION reply when the lease
has expired for these RPCs.  The client will then call nfscl_recover()
to handle the NFSERR_BADSESSION reply.  However, for the expired lease
case, the first reclaim Open will fail with NFSERR_NOGRACE.

This patch recognizes this case and calls nfscl_expireclient()
to handle the recovery from an expired lease.

This patch only affects NFSv4.1/4.2 mounts when the lease
expires on the server, due to a network partitioning that
exceeds the lease duration or similar.

(cherry picked from commit c28cb257dd)
2021-06-02 16:54:10 -07:00
Rick Macklem
628d207646 nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open
The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH
variant of the Open operation when delegations are recalled and
the client has a local open of the file.  This patch adds
support for this variant of Open to the NFSv4.1/4.2 server.

This patch only affects mounts from Linux clients when delegations
are enabled on the server.

(cherry picked from commit b3d4c70dc6)
2021-05-31 18:34:47 -07:00
Rick Macklem
4ce25ce477 nfsd: Reduce the callback timeout to 800msec
Recent discussion on the nfsv4@ietf.org mailing list confirmed
that an NFSv4 server should reply to an RPC in less than 1second.
If an NFSv4 RPC requires a delegation be recalled,
the server will attempt a CB_RECALL callback.
If the client is not responsive, the RPC reply will be delayed
until the callback times out.
Without this patch, the timeout is set to 4 seconds (set in
ticks, but used as seconds), resulting in the RPC reply taking over 4sec.
This patch redefines the constant as being in milliseconds and it
implements that for a value of 800msec, to ensure the RPC
reply is sent in less than 1second.

This patch only affects mounts from clients when delegations
are enabled on the server and the client is unresponsive to callbacks.

(cherry picked from commit fc0dc94029)
2021-05-31 18:29:03 -07:00
Konstantin Belousov
40b64abff4 Move mnt_maxsymlinklen into appropriate fs mount data structures
For MFC, mnt_maxsymlinklen was replaced by padding of type u_int,
to restore KBI after 57d877348b.

(cherry picked from commit f784da883f)
2021-06-01 02:48:16 +03:00
Rick Macklem
4a4a174959 NFSv4 server: Re-establish the delegation recall timeout
Commit 7a606f280a allowed the server to do retries of CB_RECALL
callbacks every couple of seconds.  This was needed to allow the
Linux client to re-establish the back channel.
However this patch broke the delegation timeout check, such that
it would just keep retrying CB_RECALLS.
If the client has crashed or been network patitioned from the
server, this continues until the client TCP reconnects to
the server and re-establishes the back channel.

This patch modifies the code such that it still times out the
delegation recall after some minutes, so that the server will
allow the conflicting client request once the delegation times out.

This patch only affects the NFSv4 server when delegations are
enabled and a NFSv4 client that holds a delegation has crashed
or been network partitioned from the server for at least several
minutes when a delegation needs to be recalled.

(cherry picked from commit 46269d66ed)
2021-05-30 20:34:03 -07:00
Konstantin Belousov
67e2940b29 nullfs: dirty v_object must imply the need for inactivation
(cherry picked from commit 42881526d4)
2021-05-29 14:48:09 +03:00
Mateusz Guzik
443baed524 tmpfs: reimplement the mtime scan to use the lazy list
Tested by:	pho
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D30065

(cherry picked from commit eec2e4ef7f)
2021-05-22 18:28:55 +00:00
Mateusz Guzik
90b82ea9a6 vm: add another pager private flag
Contrary to what was done in main, skip the following in order to not
disrupt KBI:
Move OBJ_SHADOWLIST around to let pager flags be next to each other.

(cherry picked from commit 128e25842e)
2021-05-22 18:28:29 +00:00