#
c733c49c |
| 11-Jan-2017 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Don't apply change_info4 twice on rename within a directory
If a file is renamed, but stays in the same directory, we will still receive 2 change_info4 structures describing the change to tha
NFSv4: Don't apply change_info4 twice on rename within a directory
If a file is renamed, but stays in the same directory, we will still receive 2 change_info4 structures describing the change to that directory, but we only want to apply it once.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
2dfc6173 |
| 11-Jan-2017 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Call update_changeattr() from _nfs4_proc_open only if a file was created
We don't want to invalidate the directory attribute and data cache unless we know that a file was created, or the chan
NFSv4: Call update_changeattr() from _nfs4_proc_open only if a file was created
We don't want to invalidate the directory attribute and data cache unless we know that a file was created, or the change attribute differs from the one in our cache.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
4b09ec4b |
| 05-Jan-2017 |
Benjamin Coddington <bcodding@redhat.com> |
nfs: Don't take a reference on fl->fl_file for LOCK operation
I have reports of a crash that look like __fput() was called twice for a NFSv4.0 file. It seems possible that the state manager could t
nfs: Don't take a reference on fl->fl_file for LOCK operation
I have reports of a crash that look like __fput() was called twice for a NFSv4.0 file. It seems possible that the state manager could try to reclaim a lock and take a reference on the fl->fl_file at the same time the file is being released if, during the close(), a signal interrupts the wait for outstanding IO while removing locks which then skips the removal of that lock.
Since 83bfff23e9ed ("nfs4: have do_vfs_lock take an inode pointer") has removed the need to traverse fl->fl_file->f_inode in nfs4_lock_done(), taking that reference is no longer necessary.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
8ac2b422 |
| 19-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Retry the DELEGRETURN if the embedded GETATTR is rejected with EACCES
If our DELEGRETURN RPC call is rejected with an EACCES call, then we should remove the GETATTR call from the compound RPC
NFSv4: Retry the DELEGRETURN if the embedded GETATTR is rejected with EACCES
If our DELEGRETURN RPC call is rejected with an EACCES call, then we should remove the GETATTR call from the compound RPC and retry. This could potentially happen when there is a conflict between an ACL denying attribute reads and our use of SP4_MACH_CRED.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
f07d4a31 |
| 19-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFS: Retry the CLOSE if the embedded GETATTR is rejected with EACCES
If our CLOSE RPC call is rejected with an EACCES call, then we should remove the GETATTR call from the compound RPC and retry. Th
NFS: Retry the CLOSE if the embedded GETATTR is rejected with EACCES
If our CLOSE RPC call is rejected with an EACCES call, then we should remove the GETATTR call from the compound RPC and retry. This could potentially happen when there is a conflict between an ACL denying attribute reads and our use of SP4_MACH_CRED.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
d8d84983 |
| 19-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Place the GETATTR operation before the CLOSE
In order to benefit from the DENY share lock protection, we should put the GETATTR operation before the CLOSE. Otherwise, we might race with a Win
NFSv4: Place the GETATTR operation before the CLOSE
In order to benefit from the DENY share lock protection, we should put the GETATTR operation before the CLOSE. Otherwise, we might race with a Windows machine that thinks it is now safe to modify the file.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
9413a1a1 |
| 19-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Also ask for attributes when downgrading to a READ-only state
If we're downgrading from a READ+WRITE mode to a READ-only mode, then ask for cache consistency attributes so that we avoid the r
NFSv4: Also ask for attributes when downgrading to a READ-only state
If we're downgrading from a READ+WRITE mode to a READ-only mode, then ask for cache consistency attributes so that we avoid the revalidation in nfs_close_context()
Fixes: 3947b74d0f9d ("NFSv4: Don't request a GETATTR on open_downgrade.") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
0bc2c9b4 |
| 16-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURN
DELEGRETURN will always carry a reference to the inode except when the latter is being freed, so let's ensure that we always
NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURN
DELEGRETURN will always carry a reference to the inode except when the latter is being freed, so let's ensure that we always use that inode information to ensure close-to-open cache consistency, even when the DELEGRETURN call is asynchronous.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
e603a4c1 |
| 16-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Update the attribute cache info in update_changeattr
If we successfully updated the change attribute, we should timestamp the cache. While we do know that the other attributes are not complet
NFSv4: Update the attribute cache info in update_changeattr
If we successfully updated the change attribute, we should timestamp the cache. While we do know that the other attributes are not completely up to date, we have the NFS_INO_INVALID_ATTR flag that let us know that, so it is valid to say that the cache has not timed out. We can also clear NFS_INO_REVAL_PAGECACHE, since our change attribute is now known to be valid.
Conversely, if the change attribute did not match, we should make sure to also revalidate the access and ACL caches.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
dff25ddb |
| 02-Dec-2016 |
Andreas Gruenbacher <agruenba@redhat.com> |
nfs: add support for the umask attribute
Clients can set the umask attribute when creating files to cause the server to apply it always except when inheriting permissions from the parent directory.
nfs: add support for the umask attribute
Clients can set the umask attribute when creating files to cause the server to apply it always except when inheriting permissions from the parent directory. That way, the new files will end up with the same permissions as files created locally.
See https://tools.ietf.org/html/draft-ietf-nfsv4-umask-02 for more details.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
2f065ddb |
| 07-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
pNFS: Layoutreturn must free the layout after the layout-private data
The layout-private data may depend on the layout and/or the inode still existing when it does post-processing and frees its data
pNFS: Layoutreturn must free the layout after the layout-private data
The layout-private data may depend on the layout and/or the inode still existing when it does post-processing and frees its data, so we need to free them after calling lrp->ld_private.ops->free().
This fixes a mirror list corruption issue in the flexfiles driver.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
7a0566b3 |
| 06-Dec-2016 |
NeilBrown <neilb@suse.com> |
NFSv4: Add missing nfs_put_lock_context()
Otherwise the lock context won't be freed when we're done with it.
From: NeilBrown <neilb@suse.com> Fixes: 5bd3f817 ("NFSv4: change nfs4_select_rw_stateid
NFSv4: Add missing nfs_put_lock_context()
Otherwise the lock context won't be freed when we're done with it.
From: NeilBrown <neilb@suse.com> Fixes: 5bd3f817 ("NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of lock_owner") Signed-off-by: Anna Schumaker <Anna.Schumaker@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
2cf10cdd |
| 04-Dec-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4.1: Handle NFS4ERR_BADSESSION/NFS4ERR_DEADSESSION replies to OP_SEQUENCE
In the case where SEQUENCE receives a NFS4ERR_BADSESSION or NFS4ERR_DEADSESSION error, we just want to report the sessio
NFSv4.1: Handle NFS4ERR_BADSESSION/NFS4ERR_DEADSESSION replies to OP_SEQUENCE
In the case where SEQUENCE receives a NFS4ERR_BADSESSION or NFS4ERR_DEADSESSION error, we just want to report the session as needing recovery, and then we want to retry the operation.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
4d796d75 |
| 23-Sep-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
pNFS: Allow layout drivers to manage private data in struct nfs4_layoutreturn
Cleanup to allow layout drivers to attach private data to layoutreturn, and manage the data.
Signed-off-by: Trond Mykle
pNFS: Allow layout drivers to manage private data in struct nfs4_layoutreturn
Cleanup to allow layout drivers to attach private data to layoutreturn, and manage the data.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
17393475 |
| 12-Oct-2016 |
NeilBrown <neilb@suse.com> |
NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of lock_owner
The only time that a lock_context is not immediately available is in setattr, and now that it has an open_context, i
NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of lock_owner
The only time that a lock_context is not immediately available is in setattr, and now that it has an open_context, it can easily find one with nfs_get_lock_context. This removes the need for the on-stack nfs_lockowner.
This change is preparation for correctly support flock stateids.
Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
29b59f94 |
| 12-Oct-2016 |
NeilBrown <neilb@suse.com> |
NFSv4: change nfs4_do_setattr to take an open_context instead of a nfs4_state.
The open_context can always lead directly to the state, and is always easily available, so this is a straightforward ch
NFSv4: change nfs4_do_setattr to take an open_context instead of a nfs4_state.
The open_context can always lead directly to the state, and is always easily available, so this is a straightforward change. Doing this makes more information available to _nfs4_do_setattr() for use in the next patch.
Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
532d4def |
| 12-Oct-2016 |
NeilBrown <neilb@suse.com> |
NFSv4: add flock_owner to open context
An open file description (struct file) in a given process can be associated with two different lock owners.
It can have a Posix lock owner which will be diffe
NFSv4: add flock_owner to open context
An open file description (struct file) in a given process can be associated with two different lock owners.
It can have a Posix lock owner which will be different in each process that has a fd on the file. It can have a Flock owner which will be the same in all processes.
When searching for a lock stateid to use, we need to consider both of these owners
So add a new "flock_owner" to the "nfs_open_context" (of which there is one for each open file description).
This flock_owner does not need to be reference-counted as there is a 1-1 relation between 'struct file' and nfs open contexts, and it will never be part of a list of contexts. So there is no need for a 'flock_context' - just the owner is enough.
The io_count included in the (Posix) lock_context provides no guarantee that all read-aheads that could use the state have completed, so not supporting it for flock locks in not a serious problem. Synchronization between flock and read-ahead can be added later if needed.
When creating an open_context for a non-openning create call, we don't have a 'struct file' to pass in, so the lock context gets initialized with a NULL owner, but this will never be used.
The flock_owner is not used at all in this patch, that will come later.
Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
b184b5c3 |
| 12-Oct-2016 |
NeilBrown <neilb@suse.com> |
NFS: remove l_pid field from nfs_lockowner
this field is not used in any important way and probably should have been removed by
Commit: 8003d3c4aaa5 ("nfs4: treat lock owners as opaque values")
wh
NFS: remove l_pid field from nfs_lockowner
this field is not used in any important way and probably should have been removed by
Commit: 8003d3c4aaa5 ("nfs4: treat lock owners as opaque values")
which removed the pid argument from nfs4_get_lock_state.
Except in unusual and uninteresting cases, two threads with the same ->tgid will have the same ->files pointer, so keeping them both for comparison brings no benefit.
Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
53e6fc86 |
| 19-Nov-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
pNFS: Prevent unnecessary layoutreturns after delegreturn
If we cannot grab the inode or superblock, then we cannot pin the layout header, and so we cannot send a layoutreturn as part of an async de
pNFS: Prevent unnecessary layoutreturns after delegreturn
If we cannot grab the inode or superblock, then we cannot pin the layout header, and so we cannot send a layoutreturn as part of an async delegreturn call. In this case, we currently end up sending an extra layoutreturn after the delegreturn. Since the layout was implicitly returned by the delegreturn, that just gets a BAD_STATEID.
The fix is to simply complete the return-on-close immediately.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
1c5bd76d |
| 16-Nov-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
pNFS: Enable layoutreturn operation for return-on-close
Amend the pnfs return on close helper functions to enable sending the layoutreturn op in CLOSE/DELEGRETURN. This closes a potential race betwe
pNFS: Enable layoutreturn operation for return-on-close
Amend the pnfs return on close helper functions to enable sending the layoutreturn op in CLOSE/DELEGRETURN. This closes a potential race between CLOSE/DELEGRETURN and parallel OPEN calls to the same file, and allows the client and the server to agree on whether or not there is an outstanding layout.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
586f1c39 |
| 15-Nov-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Add encode/decode of the layoutreturn op in DELEGRETURN
Add XDR encoding for the layoutreturn op, and storage for the layoutreturn arguments to the DELEGRETURN compound.
Signed-off-by: Trond
NFSv4: Add encode/decode of the layoutreturn op in DELEGRETURN
Add XDR encoding for the layoutreturn op, and storage for the layoutreturn arguments to the DELEGRETURN compound.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
cf805165 |
| 15-Nov-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Add encode/decode of the layoutreturn op in CLOSE
Add XDR encoding for the layoutreturn op, and storage for the layoutreturn arguments to the CLOSE compound.
Signed-off-by: Trond Myklebust <
NFSv4: Add encode/decode of the layoutreturn op in CLOSE
Add XDR encoding for the layoutreturn op, and storage for the layoutreturn arguments to the CLOSE compound.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
2a974425 |
| 20-Nov-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Ignore LAYOUTRETURN result if the layout doesn't match or is invalid
Fix a potential race with CB_LAYOUTRECALL in which the server recalls the remaining layout segments while our LAYOUTRETURN
NFSv4: Ignore LAYOUTRETURN result if the layout doesn't match or is invalid
Fix a potential race with CB_LAYOUTRECALL in which the server recalls the remaining layout segments while our LAYOUTRETURN is still in transit.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
68f74479 |
| 12-Oct-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
pNFS: Do not free layout segments that are marked for return
We may want to process and transmit layout stat information for the layout segments that are being returned, so we should defer freeing t
pNFS: Do not free layout segments that are marked for return
We may want to process and transmit layout stat information for the layout segments that are being returned, so we should defer freeing them until after the layoutreturn has completed.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|
#
3ecefc92 |
| 27-Oct-2016 |
Trond Myklebust <trond.myklebust@primarydata.com> |
NFSv4: Don't request close-to-open attribute when holding a delegation
If holding a delegation, we do not need to ask the server to return close-to-open cache consistency attributes as part of the C
NFSv4: Don't request close-to-open attribute when holding a delegation
If holding a delegation, we do not need to ask the server to return close-to-open cache consistency attributes as part of the CLOSE compound.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
show more ...
|