Commit graph

5091 commits

Author SHA1 Message Date
Franco Fichtner
c17290fc07 tmpfs: allow recurse as that does happen when using unionfs 2024-06-03 11:06:53 +02:00
Rick Macklem
2c65656b29 nfsd: Fix Link conformance with RFC8881 for delegations
RFC8881 specifies that, when a Link operation occurs on an
NFSv4, that file delegations issued to other clients must
be recalled.  Discovered during a recent discussion on nfsv4@ietf.org.

Although I have not observed a problem caused by not doing
the required delegation recall, it is definitely required
by the RFC, so this patch makes the server do the recall.

Tested during a recent NFSv4 IETF Bakeathon event.

Approved by:	re (cperciva)

(cherry picked from commit 3f65000b6b1460a7a23cd83014bb41a68d1a8a19)
(cherry picked from commit 3c414a8c2f)
2024-05-12 21:49:04 -07:00
Mark Johnston
b6a2ce76d6 udf: uma_zcreate() does not fail
While here remove an old comment regarding preallocation; it appears to
refer to an optimization that is almost certainly irrelevant at this
point.

No functional change intended.

MFC after:	1 week

(cherry picked from commit 78c51db3c4927db2437ec616b33ba1faf73f08ee)
2024-05-02 09:25:08 -04:00
Rick Macklem
a3b8266f54 nfscl: Clear out a lot of cruft related to B_DIRECT
There is only one place in the unpatched sources where B_DIRECT is
set in the NFS client and this code is never executed. As such, this patch
removes this code that is never executed, since B_DIRECT should never
be set.

During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(),
but this function is only called if B_DIRECT is set.
I cannot explain how ncl_doio_directwrite() got called, but once this patch
was applied to the sources, the crash did not recur. This is not surprising,
since this patch deleted the function.

(cherry picked from commit 03a39a17089adc1d0e28076670e664dcdebccf73)
2024-04-30 18:06:36 -07:00
Rick Macklem
c91861cc21 nfscl: Do not use nfso_own for delayed nfsrpc_doclose()
When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY,
the open structure is put on a list for delayed closing.  When this
is done, the nfso_own field is set to NULL, so it cannot be used by
nfsrpc_doclose().

Without this patch, the NFSv4 client can crash when a NFSv4 server
replies NFSERR_DELAY to a Close operation.  Fortunately, most extant
NFSv4 servers do not do this.  This patch avoids the crash for any
that do return NFSERR_DELAY for Close.

Found during a IETF bakeathon testing event this week.

(cherry picked from commit 6251027c4252edb3b8f8fc359a40e610349e9af3)
2024-04-30 18:04:52 -07:00
Rick Macklem
aab7104564 Revert "nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH"
This reverts commit f300335d9aebf2e99862bf783978bd44ede23550.

It turns out that the old code was correct and it was wireshark
that was broken and indicated that the RPC's XDR was bogus.
Found during IETF bakeathon testing this week.

(cherry picked from commit 54c3aa02e926268ba5551cd7d28fddf38b3589a2)
2024-04-27 18:36:04 -07:00
Rick Macklem
2fe5dc8691 nfscl: Revert part of commit 196787f79e67
Commit 196787f79e67 erroneously assumed that the client code for
Open/Claim_deleg_cur_FH was broken, but it was not.
It was actually wireshark that was broken and indicated
that the correct XDR was bogus.

This reverts the part of 196787f79e67 that changed the arguments for
Open/Claim_deleg_cur_FH.

Found during the IETF bakeathon testing event this week.

(cherry picked from commit 8efba70d7914324890b1f8fe3079036eb2b5c3db)
2024-04-27 17:35:22 -07:00
Jason A. Harmening
c8d6c9351a unionfs_lookup(): fix wild accesses to vnode private data
There are a few spots in which unionfs_lookup() accesses unionfs vnode
private data without holding the corresponding vnode lock or interlock.

Reviewed by:		kib, olce
Differential Revision:	https://reviews.freebsd.org/D44601

(cherry picked from commit b18029bc59d2ed6b0eeeb233189cf713b34b467c)
2024-04-27 12:42:36 -05:00
Mark Johnston
32004d854a nfsserver: Rate-limit messages about requests from unprivileged ports
If access from unreserved ports is disabled, then a remote host can
cause an NFS server to log a message by sending a packet.  This is
useful for diagnosing problems but bad for resiliency in the case where
the server is being spammed with a large number of rejected requests.

Limit prints to once per second (racily).

Reviewed by:	rmacklem, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44819

(cherry picked from commit b7e4666d7b69c22699a9299687018a892a5dad5b)
2024-04-25 09:20:16 -04:00
Dag-Erling Smørgrav
0ee0770faf nullfs: Show correct exported flag.
MFC after:	3 days
Reviewed by:	allanjude, kib
Differential Revision:	https://reviews.freebsd.org/D44773

(cherry picked from commit 2b258dd17caf329bc549f93d9858b74109a479d7)
2024-04-22 15:48:15 +02:00
Doug Rabson
a1e55af8d1 Fix MNT_IGNORE for devfs, fdescfs and nullfs
The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.

The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.

MFC after:	1 week

(cherry picked from commit b5c4616582cebdcf4dee909a3c2f5b113c4ae59e)
2024-04-22 15:48:15 +02:00
Alan Somers
2d19c2cd00 fusefs: correct a comment
[skip ci]

Sponsored by:	Axcient

(cherry picked from commit c1326c01df81dd06739ddf1946e1968ddaba0c8e)
2024-04-21 08:10:47 -06:00
Emil Tsalapatis
61ddfc0e55 fusefs: only test for incoherency if FN_SIZECHANGE is set
FUSE emits spurious incoherency warnings in writethrough mode. The
warnings are triggered by setattr calls generated by vnode truncation
turning the cached va_size vattr stale, causing comparisons with the
fresh version provided by the server to fail. Only validate the vnode's
va_size vattr if the FN_SIZECHANGE flag is set.

This is a part of the research work at RCSLab, University of Waterloo.

Reviewed by:	asomers
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1110

(cherry picked from commit 8758bf0aaec1d4b2ebcb429e8cabc691c2c95461)
2024-04-21 08:09:43 -06:00
Zaphrod Beeblebrox
40631b79b5 nfscl: Purge name cache when readdir_plus is done
The author reported that this patch was needed to avoid
crashes on a fairly busy RISC-V system.  The author did not
provide details w.r.t. the crashes.  Although I
have not seen any such crash, the patch looks reasonable
and I have not found any regressions when testing it.

Since "rdirplus" is not a default option, the patch is
only needed if you are doing NFS mounts with the "rdirplus"
mount option and seeing crashes related to the name cache.

(cherry picked from commit d00c64bb2347cc620d31a178c7755aa7e594f065)
2024-04-17 17:49:10 -07:00
Mark Johnston
268afe7247 tarfs: Implement VOP_BMAP
This lets tarfs provide readahead/behind hints to the VFS, which helps
memory-mapped I/O performance, important when running faulting in
executables out of a tarfs mount as one might if tarfs is used to back
the root filesystem, for example.  The improvement is particularly
noticeable when the backing tarball is zstd-compressed.

The implementation simply returns the extent of the virtual block
containing the target offset, clamped by the maximum I/O size.  This is
perhaps simplistic; it effectively just chooses values that would
correspond to a single VOP_READ call in tarfs_read_file().

Reviewed by:	des, kib
MFC after:	1 month
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44626

(cherry picked from commit a0895e394d3fec374e61a207bdfa0245dae86f53)
2024-04-15 10:06:12 -04:00
Mark Johnston
a006c6a0d4 tarfs: Inherit mnt_iosize_max from the lower vnode
There is no obvious reason to use a value smaller than that.

Reviewed by:	des, kib
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44627

(cherry picked from commit 91eca18551554b7aca80fcfd3c648f524b321252)
2024-04-15 10:05:13 -04:00
Ricardo Branco
1449754218 cd9660: Add support for mask,dirmask,uid,gid options
Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/982

(cherry picked from commit 82f2275b73e556580b155ea9bbf7f7e364458fa1)
2024-04-08 10:25:46 -07:00
Dag-Erling Smørgrav
59c3e7a18c tarfs: Support paths that spill into exthdrs.
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44599

(cherry picked from commit b1fd95c9e24791d44593e611406b41e57826a5b8)

tarfs: Ignore global extended headers.

Previously, we would error out if we encountered a global extended
header, because we don't know what it means.  This doesn't really
matter though, and traditionally, tar implementations have either
ignored them or treated them as plain files, so just ignore them.
This allows tarfs to mount tar files created by `git archive`.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44600

(cherry picked from commit 584e1c355ae3c994331005b7196cc87a714e5317)

tarfs: Fix 32-bit build.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44613

(cherry picked from commit 0238d3711d9b888f678fce4274eccc9175168395)
2024-04-08 12:10:41 +02:00
Jason A. Harmening
7b86d14bfc unionfs: implement VOP_UNP_* and remove special VSOCK vnode handling
unionfs has a bunch of clunky special-case code to avoid creating
unionfs wrapper vnodes for AF_UNIX sockets.  This was added in 2008
to address PR 118346, but in the intervening years the VOP_UNP_*
operations have been added to provide a clean interface to allow
sockets to work in the presence of stacked filesystems.

PR:			275871
Reviewed by:		kib (prior version), olce
Tested by:		Karlo Miličević <karlo98.m@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D44288

(cherry picked from commit eee6217b40df5877674df1d9aec7d5bd04202876)
2024-04-06 19:27:00 -05:00
Konstantin Belousov
cde0347ca7 cdevpriv(9): add iterator
(cherry picked from commit d3efbe0132b24e8660df836905cda7662f85a154)
2024-03-30 10:31:13 +02:00
Rick Macklem
b525301850 nfsd: Add a sysctl to limit NFSv4.2 Copy RPC size
NFSv4.2 supports a Copy operation, which avoids file data being
read to the client and then written back to the server, if both
input and output files are on the same NFSv4.2 mount for
copy_file_range(2).

Unfortunately, this Copy operation can take a long time under
certain circumstances.  If this occurs concurrently with a RPC
that requires an exclusive lock on the nfsd such as ExchangeID
done for a new mount, the result can be an nfsd "stall" until
the Copy completes.

This patch adds a sysctl that can be set to limit the size of
a Copy operation or, if set to 0, disable Copy operations.

The use of this sysctl and other ways to avoid Copy operations
taking too long will be documented in the nfsd.4 man page by
a separate commit.

(cherry picked from commit 748f56c53f4286e0b140c1b779ff8ade1cf4fec9)
2024-03-29 17:58:33 -07:00
Jason A. Harmening
6d118b9586 unionfs: accommodate underlying FS calls that may re-lock
Since non-doomed unionfs vnodes always share their primary lock with
either the lower or upper vnode, any forwarded call to the base FS
which transiently drops that upper or lower vnode lock may result in
the unionfs vnode becoming completely unlocked during that transient
window.  The unionfs vnode may then become doomed by a concurrent
forced unmount, which can lead to either or both of the following:

--Complete loss of the unionfs lock: in the process of being
  doomed, the unionfs vnode switches back to the default vnode lock,
  so even if the base FS VOP reacquires the upper/lower vnode lock,
  that no longer translates into the unionfs vnode being relocked.
  This will then violate that caller's locking assumptions as well
  as various assertions that are enabled with DEBUG_VFS_LOCKS.

--Complete less of reference on the upper/lower vnode: the caller
  normally holds a reference on the unionfs vnode, while the unionfs
  vnode in turn holds references on the upper/lower vnodes.  But in
  the course of being doomed, the unionfs vnode will drop the latter
  set of references, which can effectively lead to the base FS VOP
  executing with no references at all on its vnode, violating the
  assumption that vnodes can't be recycled during these calls and
  (if lucky) violating various assertions in the base FS.

Fix this by adding two new functions, unionfs_forward_vop_start_pair()
and unionfs_forward_vop_finish_pair(), which are intended to bookend
any forwarded VOP which may transiently unlock the relevant vnode(s).
These functions are currently only applied to VOPs that modify file
state (and require vnode reference and lock state to be identical at
call entry and exit), as the common reason for transiently dropping
locks is to update filesystem metadata.

Reviewed by:	olce
Tested by:	pho
Differential Revision: https://reviews.freebsd.org/D44076

(cherry picked from commit 6c8ded001540fd969ebc2eabd45a0066ebcc662b)
2024-03-23 21:55:37 -05:00
Konstantin Belousov
37ab169e38 nullfs_mount(): fix whitespace
(cherry picked from commit 4e8d264b0057e80ed2c1086da30d5e2391d82ffc)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
adcb01c08e nullfs: add -o cache
(cherry picked from commit 8921216dbee6884532e22d5347cff4d9ed23e782)
2024-03-13 02:30:41 +02:00
Konstantin Belousov
a79bb016d9 nullfs_mount(): remove unneeded cast
(cherry picked from commit 0724293331e4c35c0a8cc5b8922a153545725c24)
2024-03-13 02:30:41 +02:00
Seigo Tanimura
3ba93b50d6 nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default
(cherry picked from commit c849eb8f1925f95ebfb8dbbe00672d902486a973)
2024-03-13 02:30:40 +02:00
Dag-Erling Smørgrav
08e799c0cc tarfs: Fix two input validation issues.
* Reject hard or soft links with an empty target path.  Currently, a
  debugging kernel will hit an assertion in tarfs_lookup_path() while
  a non-debugging kernel will happily create a link to the mount root.

* Use a temporary variable to store the result of the link target path,
  and copy it to tnp->other only once we have found it to be valid.
  Otherwise we error out after creating a reference to the target but
  before incrementing the target's reference count, which results in a
  use-after-free situation in the cleanup code.

* Correctly return ENOENT from tarfs_lookup_path() if the requested
  path was not found and create_dirs is false.  Luckily, existing
  callers did not rely solely on the return value.

MFC after:	3 days
PR:		277360
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D44161

(cherry picked from commit 38b3683592d4c20a74f52a6e8e29368e6fa61858)

tarfs: Improve validation of numeric fields.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	sjg, allanjude
Differential Revision:	https://reviews.freebsd.org/D44166

(cherry picked from commit 8427d94ce05682abb6c75e2a27c8c497962c0dc5)

tarfs: Avoid overflow in exthdr calculation.

MFC after:	3 days
PR:		277420
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44202

(cherry picked from commit c291b7914e1db9469cc820abcb1f5dde7a6f7f28)

tarfs: Remove unnecessary hack and obsolete comment.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44203

(cherry picked from commit e212f0c0666e7d3a24dce03b8c88920d14b80e47)

tarfs: Fix checksum calculation.

The checksum code assumed that struct ustar_header filled an entire
block and calculcated the checksum based on the size of the structure.
The header is in fact only 500 bytes long while the checksum covers
the entire block (“logical record” in POSIX terms).  Add padding and
an assertion, and clean up the checksum code.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44226

(cherry picked from commit 0118b0c8e58a438a931a5ce1bf8d7ae6208cc61b)

tarfs: Factor out common test code.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44227

(cherry picked from commit 32b8aac6f9b77a1c4326083472d634e5de427547)

tarfs: Fix checksum on 32-bit platforms.

MFC after:	3 days
Fixes:		b56872332e47786afc09515a4daaf1388da4d73c
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44261

(cherry picked from commit cbddb2f02c7687d1039abcffd931e94e481c11a5)
2024-03-11 13:19:06 +01:00
Jason A. Harmening
5e806288f0 unionfs: cache upper/lower mount objects
Store the upper/lower FS mount objects in unionfs per-mount data and
use these instead of the v_mount field of the upper/lower root
vnodes.  As described in the referenced PR, it is unsafe to access this
field on the unionfs unmount path as ZFS rollback may have obliterated
the v_mount field of the upper or lower root vnode.  Use these stored
objects to slightly simplify other code that needs access to the
upper/lower mount objects as well.

PR:		275870
Reported by:	Karlo Miličević <karlo98.m@gmail.com>
Tested by:	Karlo Miličević <karlo98.m@gmail.com>
Reviewed by:	kib (prior version), olce
Differential Revision: https://reviews.freebsd.org/D43815

(cherry picked from commit cc3ec9f7597882d36ee487fd436d1b90bed0ebfd)
2024-03-04 12:31:49 -06:00
Jason A. Harmening
9c53057875 unionfs: upgrade the vnode lock during fsync() if necessary
If the underlying upper FS supports shared locking for write ops,
as is the case with ZFS, VOP_FSYNC() may only be called with the vnode
lock held shared.  In this case, temporarily upgrade the lock for
those unionfs maintenance operations which require exclusive locking.

While here, make unionfs inherit the upper FS' support for shared
write locking.  Since the upper FS is the target of VOP_GETWRITEMOUNT()
this is what will dictate the locking behavior of any unionfs caller
that uses vn_start_write() + vn_lktype_write(), so unionfs must be
prepared for the caller to only hold a shared vnode lock in these
cases.

Found in local testing of unionfs atop ZFS with DEBUG_VFS_LOCKS.

Reviewed by:	kib, olce
Differential Revision: https://reviews.freebsd.org/D43817

(cherry picked from commit 2656fc29be8b0fc1cd9e64ed52aa0a61fe87744c)
2024-03-04 12:31:44 -06:00
Jason A. Harmening
c18e6a5a5c unionfs: work around underlying FS failing to respect cn_namelen
unionfs_mkshadowdir() may be invoked on a non-leaf pathname component
during lookup, in which case the NUL terminator of the pathname buffer
will be well beyond the end of the current component.  cn_namelen in
this case will still (correctly) indicate the length of only the
current component, but ZFS in particular does not currently respect
cn_namelen, leading to the creation on inacessible files with slashes
in their names.  Work around this behavior by temporarily NUL-
terminating the current pathname component for the call to VOP_MKDIR().

https://github.com/openzfs/zfs/issues/15705 has been filed to track
a proper upstream fix for the issue at hand.

PR:		275871
Reported by:	Karlo Miličević <karlo98.m@gmail.com>
Tested by:	Karlo Miličević <karlo98.m@gmail.com>
Reviewed by:	kib, olce
Differential Revision: https://reviews.freebsd.org/D43818

(cherry picked from commit a2ddbe019d51b35f9da2cb5ddca8c69f0ee422da)
2024-03-04 12:31:25 -06:00
Konstantin Belousov
b2c9d403d5 fs/msdosfs fatblock: use ulmin() rather than min()
PR:	277237

(cherry picked from commit 0085afdceb17cb7d4e41f9073299f688372c6a0f)
2024-03-01 06:12:02 +02:00
Stefan Eßer
fba1a994ac msdosfs: fix potential inode collision on FAT12 and FAT16
PR:             277239
Approved by:	mckusick

(cherry picked from commit 445d3d227e68f85157d0301d1706aa488e8423da)
2024-02-23 11:47:58 +01:00
Stefan Eßer
5f41ed8d09 msdosfs: fix directory corruption after rename operation
(cherry picked from commit 8b67c670a49b4efe7e1557121b5bbae682ea3bc7)
2024-02-20 22:48:08 +01:00
Alan Somers
739488cc21 fusefs: fix invalid value for st_birthtime.tv_nsec
If a file system's on-disk format does not support st_birthtime, it
isn't clear what value it should return in stat(2).  Neither our man
page nor the OpenGroup specifies.  But our convention for UFS and
msdosfs is to return { .tv_sec = -1, .tv_nsec = 0 }.  fusefs is
different.  It returns { .tv_sec = -1, .tv_nsec = -1 }.  It's done that
ever since the initial import in SVN r241519.

Most software apparently handles this just fine.  It must, because we've
had no complaints.  But the Rust standard library will panic when
reading such a timestamp during std::fs::metadata, even if the caller
doesn't care about that particular value.  That's a separate bug, and
should be fixed.

Change our invalid value to match msdosfs and ufs, pacifying the Rust
standard library.

PR:		276602
Sponsored by:	Axcient
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D43590

(cherry picked from commit 55b80e2ca52c4b27c4920d372a6e71ac9ab7da9e)
2024-02-12 10:43:11 -07:00
Alan Somers
9826f8eb0c fusefs: fix an interaction between copy_file_range and mmap
If a copy_file_range operation tries to read from a page that was
previously written via mmap, that page must be flushed first.

Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D43451

(cherry picked from commit 1c909c300b92601f7690610097ac98126caff835)
2024-02-12 10:42:46 -07:00
Konstantin Belousov
7dff3d1cdf kcmp(2): implement for devfs files
(cherry picked from commit 5c41d888de1aba0e82531fb6df4cc3b6989d37bd)
2024-01-30 22:24:43 +02:00
Gordon Bergling
2d631cf513 fusefs(5): Fix a typo in a SDT probe
- s/userpace/userspace/

(cherry picked from commit 6f0da017c973f40c1bc70552c922c500a0a8c858)
2024-01-25 07:46:20 +01:00
Konstantin Belousov
68d021de34 msdosfs_remount_ro(): correct vfs_unbusy() loop
PR:	276408

(cherry picked from commit 4b3ffc5918b9968ea6ddee6f6cdf3538072e5ef4)
2024-01-25 05:44:55 +02:00
Konstantin Belousov
c315699722 msdosfs_integrity_error(): plug possible busy leak
(cherry picked from commit 13ccb04589e2c5c840e19b407a59e44cb70ac28e)
2024-01-25 05:44:55 +02:00
Konstantin Belousov
884f990d95 msdosfs_rename(): implement several XXXs about downgrading to ro
(cherry picked from commit 661db9b390b4a40418d838876b58d2186d72aabf)
2024-01-25 05:44:55 +02:00
Konstantin Belousov
e465acd0f6 msdosfs_rename(): handle errors from msdosfs_lookup_ino()
PR:	276408

(cherry picked from commit be0df84849ff3e8fb5ec65176ffde88dbefdc434)
2024-01-25 05:44:55 +02:00
Gordon Bergling
d0f5ac0a72 devfs(5): Fix a typo in a source code comment
- s/interpeted/interpreted/

(cherry picked from commit 7cf293536ebacc92150be12e0be928500e670610)
2024-01-23 07:43:09 +01:00
Rick Macklem
d34f4baaf1 nfscl: Only update atime for Copy when noatime is not specified
Commit 57ce37f9dcd0 modified the NFSv4.2 Copy operation so that
it will update atime on the infd file whenever possible.
This is done by adding a Setattr of TimeAccess for the
input file.

This patch disables this change for the case of an NFSv4.2
mount with the "noatime" mount option, which avoids the
additional Setattr of TimeAccess operation.

(cherry picked from commit cc760de2183f9c9a4099783d3ff4c770521a4cb6)
2024-01-19 17:44:23 -08:00
Konstantin Belousov
64e869e9b9 Add vnode_pager_clean_{a,}sync(9)
(cherry picked from commit b068bb09a1a82d9fef0e939ad6135443a959e290)
2024-01-18 02:51:33 +02:00
Konstantin Belousov
7b49e60227 ncl_bioread(): check for vp->v_object before accessing it
(cherry picked from commit 503f72a828c7d0d938ec73ffbf62406038c69d47)
2024-01-17 12:03:51 +02:00
Konstantin Belousov
cbf323cf50 nfsclient: limit situations when we do unlocked read-ahead by nfsiod
(cherry picked from commit 70dc6b2ce314a0f32755005ad02802fca7ed186e)
2024-01-11 18:46:53 +02:00
Konstantin Belousov
62b0cb2378 nfsclient: eliminate ncl_writebp()
(cherry picked from commit 656d2e83d9eef204c132f879d55782affede2ca9)
2024-01-11 18:46:52 +02:00
Konstantin Belousov
09c69decd2 nfsclient: flush dirty pages of the vnode
PR:	276002

(cherry picked from commit 47ec00d9d6071bbb0ee5ed0bdca3c4a468334d9d)
2024-01-11 18:46:52 +02:00
Konstantin Belousov
384c72acb5 nfsclient copy_file_range(): flush dst vnode data
PR:	276002

(cherry picked from commit 7dae1467d72ae1f5c8f7be0f7444da23a457d98b)
2024-01-11 18:46:52 +02:00
Rick Macklem
dabf1797a7 nfscl: Fix handling of expired Kerberos credentials (NFSv4.1/4.2)
If the NFS server detects that the Kerberos credentials provided
by a NFSv4.1/4.2 mount using sec=krb5[ip] have expired, the NFS
server replies with a krpc layer error of RPC_AUTHERROR.
When this happened, the client erroneously left the NFSv4.1/4.2
session slot busy, so that it could not be used by other RPCs.
If this happened for all session slots, the mount point would
hang.

This patch fixes the problem by releasing the session slot
and resetting its sequence# upon receiving a RPC_AUTHERROR
reply.

This bug only affects NFSv4.1/4.2 mounts using sec=krb5[ip],
but has existed since NFSv4.1 client support was added to
FreeBSD.

So, why has the bug remained undetected for so long?
I cannot be sure, but I suspect that, often, the client detected
the Kerberos credential expiration before attempting the RPC.
For this case, the client would not do the RPC and, as such,
there would be no busy session slot.  Also, no hang would
occur until all session slots are busied (64 for a FreeBSD
client/server), so many cases of the bug probably went undetected?
Also, use of sec=krb5[ip] mounts are not that common.

PR:	275905

(cherry picked from commit a558130881e9d574dc5f37827fe2284667d5aba8)
2024-01-01 17:20:17 -08:00