| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
One of the most frustrating messages our sustaining team sees is
the "Lock reclaim failed!" message. Add some observability in the
client's lock reclaim logic so we can capture better data the
first time a problem occurs.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
| |
Add a trace point in the main state manager loop to observe state
recovery operation. Help track down state recovery bugs.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
| |
Static analysis with Coverity detected a memory leak
Reported-by: Colin King <colin.king@canonical.com>
Fixes: ec4b09250898 ("NFS: inter ssc open")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
| |
This is triggering problems with static analysis with Coverity
Reported-by: Colin King <colin.king@netapp.com>
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
| |
Remove duplicated include.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix sparse warning:
fs/nfs/nfs42proc.c:527:5: warning:
symbol '_nfs42_proc_copy_notify' was not declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changing a sparse file could have an effect not only on the file size,
but also on the number of blocks used by the file in the underlying
filesystem. The server's cache_consistency_bitmap doesn't update the
SPACE_USED attribute, so let's switch to the nfs4_fattr_bitmap to catch
this update whenever we do an ALLOCATE or DEALLOCATE.
This patch fixes xfstests generic/568, which tests that fallocating an
unaligned range allocates all blocks touched by that range. Without this
patch, `stat` reports 0 bytes used immediately after the fallocate.
Adding a `sleep 5` to the test also catches the update, but it's better
to do so when we know something has changed.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
|
| |
My understanding is that -EBUSY refers to the underlying device, and
that -ETXTBSY is used when attempting to access a file in use by the
kernel (like a swapfile). Changing this return code helps us pass
xfstests generic/569
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
| |
Remove NULL check before kfree, NULL check is taken care
on kfree.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
| |
remove unneeded semicolon.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The current_stateid is exported from nfs4state.c but not
declared in any of the headers. Add to nfs4_fs.h to
remove the following warning:
fs/nfs/nfs4state.c:80:20: warning: symbol 'current_stateid' was not declared. Should it be static?
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
| |
If nfs4_delegreturn_prepare needs to wait for a layoutreturn to complete
then make sure we drop the sequence slot if we hold it.
Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn operation for return-on-close")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
|
|
|
|
|
|
|
| |
If the server returns a bad or dead session error, the we don't want
to update the session slot number, but just immediately schedule
recovery and allow it to proceed.
We can/should then remove handling in other places
Fixes: 3453d5708b33 ("NFSv4.1: Avoid false retries when RPC calls are interrupted")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a check to disallow cross file systems copy offload, both
files are expected to be of NFS4.2+ type.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For small file sizes, it make sense to issue a synchronous copy (and
save an RPC callback operation). Also, for the inter copy offload,
copy len must be larger than the cost of doing a mount between the
destination and source server (14RPCs are sent during 4.x mount).
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the source server reboots after a server-to-server copy was
issued, we need to retry the copy from COPY_NOTIFY. We need to
detect that the source server rebooted and there is a copy waiting
on a destination server and wake it up.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
When a destination server sends a READ to the source server it can
get a NFS4ERR_PARTNER_NO_AUTH, which means a copy needs to be
restarted.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| | |
In case of copy is cancelled, also send OFFLOAD_CANCEL to the source
server.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If server sends ERR_OFFLOAD_DENIED error, the client must fall
back on doing copy the normal way. Return ENOTSUPP to the vfs and
fallback to regular copy.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the client sends an "inter" copy to the destination server but
it only supports "intra" copy, it can return ESTALE (since it
doesn't know anything about the file handle from the other server
and does not recognize the special case of "inter" copy). Translate
this error as ENOTSUPP and also send OFFLOAD_CANCEL to the source
server so that it can clean up state.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Mark the open created for the source file on the destination
server. Then if this open is going thru a recovery, then fail
the recovery as we don't need to be recoving a "fake" open.
We need to fail the ongoing READs and vfs_copy_file_range().
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NFSv4.2 inter server to server copy requires the destination server to
READ the data from the source server using the provided stateid and
file handle.
Given an NFSv4 stateid and filehandle from the COPY operaion, provide the
destination server with an NFS client function to create a struct file
suitable for the destiniation server to READ the data to be copied.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Support only one source server address: the same address that
the client and source server use.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Try using the delegation stateid, then the open stateid.
Only NL4_NETATTR, No support for NL4_NAME and NL4_URL.
Allow only one source server address to be returned for now.
To distinguish between same server copy offload ("intra") and
a copy between different server ("inter"), do a check of server
owner identity and also make sure server is capable of doing
a copy offload.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
| |
| |
| |
| |
| |
| |
| | |
Add a tracepoint in nfs_fh_to_dentry() for debugging issues with bad
userspace filehandles.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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 <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
In nfs_inode_find_state_and_recover() we want to mark for recovery
only those stateids that match or are older than the supplied
stateid parameter.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix the checks in nfs4_inode_make_writeable() to ignore the case where
we hold no delegations. Currently, in such a case, we automatically
flush writes.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
Ensure that we check that the delegation is valid in
nfs4_return_incompatible_delegation() before we try to return it.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
If the delegation has already been revoked, we want to avoid reclaiming
it on reboot.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If the delegation was revoked, or is already being returned, just
clear the NFS_DELEGATION_RETURN and NFS_DELEGATION_RETURN_IF_CLOSED
flags and keep going.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| | |
If the delegation was successfully returned, then mark it as revoked.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
If we revoke a delegation, but the stateid's seqid is newer, then
ensure we update the seqid when marking the delegation as revoked.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
If the server sent us a new delegation stateid that is more recent than
the one that got revoked, then clear the NFS_DELEGATION_REVOKED flag.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| | |
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
Add a check to ensure that we haven't already removed the delegation
from the inode after we take all the relevant locks.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rename nfs_inode_return_delegation_noreclaim() to
nfs_inode_evict_delegation(), which better describes what it
does.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| | |
If the delegation was revoked, we don't want to retry the delegreturn.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
If we're processsing a delegation recall, ignore the delegations that
have already been revoked or returned.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| | |
If the delegation has been revoked, ignore it.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
If the delegation is marked as being revoked, then don't use it in
the open state structure.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NFSv2, v3 and NFSv4 servers often have duplicate replay caches that look
at the source port when deciding whether or not an RPC call is a replay
of a previous call. This requires clients to perform strange TCP gymnastics
in order to ensure that when they reconnect to the server, they bind
to the same source port.
NFSv4.1 and NFSv4.2 have sessions that provide proper replay semantics,
that do not look at the source port of the connection. This patch therefore
ensures they can ignore the rebind requirement.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a NFSv3 server is being used as both a DS and as a regular NFSv3 server,
we may want to keep the IO traffic on a separate TCP connection, since
it will typically have very different timeout characteristics.
This patch therefore sets up a flag to separate the two modes of operation
for the nfs_client.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Connecting to the DS is a non-interactive, asynchronous task, so there is
no reason to fire up an extra RPC null ping in order to ensure that the
server is up.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
Add a flag to tell the nfs_client it should set RPC_CLNT_CREATE_NOPING when
creating the rpc client.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
We don't need atomic bit ops when initialising a local structure on the
stack.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
| |
| |
| |
| |
| |
| |
| | |
Simplify the struct iattr timestamp encoding by skipping the step of
an intermediate struct timespec.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|