~dannf/ubuntu/+source/linux/+git/linux:focal-nfsv4

Last commit made on 2022-01-10
Get this branch:
git clone -b focal-nfsv4 https://git.launchpad.net/~dannf/ubuntu/+source/linux/+git/linux
Only dann frazier can upload to this branch. If you are dann frazier please log in for upload directions.

Branch merges

Branch information

Name:
focal-nfsv4
Repository:
lp:~dannf/ubuntu/+source/linux/+git/linux

Recent commits

e232c39... by Trond Myklebust <email address hidden>

NFSv4: Ensure the delegation cred is pinned when we call delegreturn

Ensure we don't release the delegation cred during the call to
nfs4_proc_delegreturn().

Fixes: ee05f456772d ("NFSv4: Fix races between open and delegreturn")
Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit 5d63944f8206a80636ae8cb4b9107d3b49f43d37)
Signed-off-by: dann frazier <email address hidden>

351274d... by Trond Myklebust <email address hidden>

NFSv4: Ensure the delegation is pinned in nfs_do_return_delegation()

The call to nfs_do_return_delegation() needs to be taken without
any RCU locks. Add a refcount to make sure the delegation remains
pinned in memory until we're done.

Fixes: ee05f456772d ("NFSv4: Fix races between open and delegreturn")
Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit 8c75593c6eee0f661ddf25dfde0e6ad2a84be7a9)
Signed-off-by: dann frazier <email address hidden>

8dae180... by Trond Myklebust <email address hidden>

NFSv4: Limit the total number of cached delegations

Delegations can be expensive to return, and can cause scalability issues
for the server. Let's therefore try to limit the number of inactive
delegations we hold.
Once the number of delegations is above a certain threshold, start
to return them on close.

Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit 10717f45639f6c1bc27b56405252c3a027406d92)
Signed-off-by: dann frazier <email address hidden>

d167927... by Trond Myklebust <email address hidden>

NFSv4: Add accounting for the number of active delegations held

In order to better manage our delegation caching, add a counter
to track the number of active delegations.

Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit d2269ea14ebd2a73f291d6b3a7a7d320ec00270c)
Signed-off-by: dann frazier <email address hidden>

f759e02... by Trond Myklebust <email address hidden>

NFSv4: Try to return the delegation immediately when marked for return on close

Add a routine to return the delegation immediately upon close of the
file if it was marked for return-on-close.

Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit b7b7dac6843e483b6fe8e29cef99e3dbb7594a53)
Signed-off-by: dann frazier <email address hidden>

a85a742... by Trond Myklebust <email address hidden>

NFS: Clear NFS_DELEGATION_RETURN_IF_CLOSED when the delegation is returned

If a delegation is marked as needing to be returned when the file is
closed, then don't clear that marking until we're ready to return
it.

Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit 0d10416797c27b9e359d4bd94fb9db6f34f25d83)
Signed-off-by: dann frazier <email address hidden>

9655446... by Trond Myklebust <email address hidden>

NFSv4: nfs_inode_evict_delegation() should set NFS_DELEGATION_RETURNING

In particular, the pnfs return-on-close code will check for that flag,
so ensure we set it appropriately.

Signed-off-by: Trond Myklebust <email address hidden>
Signed-off-by: Anna Schumaker <email address hidden>
(cherry picked from commit f885ea640d65d98c8f1a326efb3abe13f1865c89)
Signed-off-by: dann frazier <email address hidden>

f1a1cfb... by Trond Myklebust <email address hidden>

NFSv4: Don't retry the GETATTR on old stateid in nfs4_delegreturn_done()

If the server returns NFS4ERR_OLD_STATEID, then just skip retrying the
GETATTR when replaying the delegreturn compound. We know nothing will
have changed on the server.

Signed-off-by: Trond Myklebust <email address hidden>
(cherry picked from commit 70d136b2dc184f1c9d026de443dbe635ea8a0839)
Signed-off-by: dann frazier <email address hidden>

648b522... by Trond Myklebust <email address hidden>

NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn

If the server returns NFS4ERR_OLD_STATEID in response to our delegreturn,
we want to sync to the most recent seqid for the delegation stateid. However
if we are already at the most recent, we have two possibilities:

- an OPEN reply is still outstanding and will return a new seqid
- an earlier OPEN reply was dropped on the floor due to a timeout.

In the latter case, we may end up unable to complete the delegreturn,
so we want to bump the seqid to a value greater than the cached value.
While this may cause us to lose the delegation in the former case,
it should now be safe to assume that the client will replay the OPEN
if necessary in order to get a new valid stateid.

Signed-off-by: Trond Myklebust <email address hidden>
(cherry picked from commit 246afc0aa5a7c66b081fbcab4d70ec379df3cb62)
Signed-off-by: dann frazier <email address hidden>

172fefb... by Trond Myklebust <email address hidden>

NFSv4: Fix races between open and delegreturn

If the server returns the same delegation in an open that we just used
in a delegreturn, we need to ensure we don't apply that stateid if
the delegreturn has freed it on the server.
To do so, we ensure that we do not free the storage for the delegation
until either it is replaced by a new one, or we throw the inode out of
cache.

Signed-off-by: Trond Myklebust <email address hidden>
(cherry picked from commit ee05f456772d4e3a04b539187473f50c394da5fa)
Signed-off-by: dann frazier <email address hidden>