summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
Commit message (Collapse)AuthorAgeFilesLines
* NFSv4.1 fix infinite loop on IO BAD_STATEID errorOlga Kornievskaia2017-03-311-6/+3
| | | | | | | | | | | | | Commit 63d63cbf5e03 "NFSv4.1: Don't recheck delegations that have already been checked" introduced a regression where when a client received BAD_STATEID error it would not send any TEST_STATEID and instead go into an infinite loop of resending the IO that caused the BAD_STATEID. Fixes: 63d63cbf5e03 ("NFSv4.1: Don't recheck delegations that have already been checked") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Cc: stable@vger.kernel.org # 4.9+ Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS prevent double free in async nfs4_exchange_idOlga Kornievskaia2017-03-171-5/+4
| | | | | | | | | | | | | | Since rpc_task is async, the release function should be called which will free the impl_id, scope, and owner. Trond pointed at 2 more problems: -- use of client pointer after free in the nfs4_exchangeid_release() function -- cl_count mismatch if rpc_run_task() isn't run Fixes: 8d89bd70bc9 ("NFS setup async exchange_id") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Cc: stable@vger.kernel.org # 4.9 Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFSv4: fix a reference leak caused WARNING messagesKinglong Mee2017-03-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because nfs4_opendata_access() has close the state when access is denied, so the state isn't leak. Rather than revert the commit a974deee47, I'd like clean the strange state close. [ 1615.094218] ------------[ cut here ]------------ [ 1615.094607] WARNING: CPU: 0 PID: 23702 at lib/list_debug.c:31 __list_add_valid+0x8e/0xa0 [ 1615.094913] list_add double add: new=ffff9d7901d9f608, prev=ffff9d7901d9f608, next=ffff9d7901ee8dd0. [ 1615.095458] Modules linked in: nfsv4(E) nfs(E) nfsd(E) tun bridge stp llc fuse ip_set nfnetlink vmw_vsock_vmci_transport vsock f2fs snd_seq_midi snd_seq_midi_event fscrypto coretemp ppdev crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_rapl_perf vmw_balloon snd_ens1371 joydev gameport snd_ac97_codec ac97_bus snd_seq snd_pcm snd_rawmidi snd_timer snd_seq_device snd soundcore nfit parport_pc parport acpi_cpufreq tpm_tis tpm_tis_core tpm i2c_piix4 vmw_vmci shpchp auth_rpcgss nfs_acl lockd(E) grace sunrpc(E) xfs libcrc32c vmwgfx drm_kms_helper ttm drm crc32c_intel mptspi e1000 serio_raw scsi_transport_spi mptscsih mptbase ata_generic pata_acpi fjes [last unloaded: nfs] [ 1615.097663] CPU: 0 PID: 23702 Comm: fstest Tainted: G W E 4.11.0-rc1+ #517 [ 1615.098015] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 [ 1615.098807] Call Trace: [ 1615.099183] dump_stack+0x63/0x86 [ 1615.099578] __warn+0xcb/0xf0 [ 1615.099967] warn_slowpath_fmt+0x5f/0x80 [ 1615.100370] __list_add_valid+0x8e/0xa0 [ 1615.100760] nfs4_put_state_owner+0x75/0xc0 [nfsv4] [ 1615.101136] __nfs4_close+0x109/0x140 [nfsv4] [ 1615.101524] nfs4_close_state+0x15/0x20 [nfsv4] [ 1615.101949] nfs4_close_context+0x21/0x30 [nfsv4] [ 1615.102691] __put_nfs_open_context+0xb8/0x110 [nfs] [ 1615.103155] put_nfs_open_context+0x10/0x20 [nfs] [ 1615.103586] nfs4_file_open+0x13b/0x260 [nfsv4] [ 1615.103978] do_dentry_open+0x20a/0x2f0 [ 1615.104369] ? nfs4_copy_file_range+0x30/0x30 [nfsv4] [ 1615.104739] vfs_open+0x4c/0x70 [ 1615.105106] ? may_open+0x5a/0x100 [ 1615.105469] path_openat+0x623/0x1420 [ 1615.105823] do_filp_open+0x91/0x100 [ 1615.106174] ? __alloc_fd+0x3f/0x170 [ 1615.106568] do_sys_open+0x130/0x220 [ 1615.106920] ? __put_cred+0x3d/0x50 [ 1615.107256] SyS_open+0x1e/0x20 [ 1615.107588] entry_SYSCALL_64_fastpath+0x1a/0xa9 [ 1615.107922] RIP: 0033:0x7fab599069b0 [ 1615.108247] RSP: 002b:00007ffcf0600d78 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 1615.108575] RAX: ffffffffffffffda RBX: 00007fab59bcfae0 RCX: 00007fab599069b0 [ 1615.108896] RDX: 0000000000000200 RSI: 0000000000000200 RDI: 00007ffcf060255e [ 1615.109211] RBP: 0000000000040010 R08: 0000000000000000 R09: 0000000000000016 [ 1615.109515] R10: 00000000000006a1 R11: 0000000000000246 R12: 0000000000041000 [ 1615.109806] R13: 0000000000040010 R14: 0000000000001000 R15: 0000000000002710 [ 1615.110152] ---[ end trace 96ed63b1306bf2f3 ]--- Fixes: a974deee47 ("NFSv4: Fix memory and state leak in...") Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFSv4: fix getacl ERANGE for some ACL buffer sizesWeston Andros Adamson2017-02-231-6/+2
| | | | | | | | | | | | | We're not taking into account that the space needed for the (variable length) attr bitmap, with the result that we'd sometimes get a spurious ERANGE when the ACL data got close to the end of a page. Just add in an extra page to make sure. Signed-off-by: Weston Andros Adamson <dros@primarydata.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* Revert "NFSv4.1: Handle NFS4ERR_BADSESSION/NFS4ERR_DEADSESSION replies to ↵Trond Myklebust2017-02-221-4/+0
| | | | | | | | | | | | | OP_SEQUENCE" This reverts commit 2cf10cdd486c362f983abdce00dc1127e8ab8c59. The patch has been seen to cause excessive looping. Reported-by: Olga Kornievskaia <aglo@umich.edu> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Cc: stable@vger.kernel.org # 4.10+ Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFSv4: Fix memory and state leak in _nfs4_open_and_get_stateTrond Myklebust2017-02-081-1/+1
| | | | | | | | | | | If we exit because the file access check failed, we currently leak the struct nfs4_state. We need to attach it to the open context before returning. Fixes: 3efb9722475e ("NFSv4: Refactor _nfs4_open_and_get_state..") Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Return the comparison result directly in nfs41_match_stateid()Anna Schumaker2017-01-301-3/+1
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Clean up nfs41_same_server_scope()Anna Schumaker2017-01-301-5/+3
| | | | | | | The function is cleaner this way, since we can use the result of memcmp() directly Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: No need to set and return status in nfs41_lock_expired()Anna Schumaker2017-01-301-2/+1
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Remove unnecessary goto in nfs4_lookup_root_sec()Anna Schumaker2017-01-301-8/+3
| | | | | | Once again, it's easier and cleaner just to return the error directly. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Remove nfs4_recover_expired_lease()Anna Schumaker2017-01-301-6/+1
| | | | | | | This function doesn't add much, since all it does is access the server's nfs_client variable. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Remove an extra if in _nfs4_recover_proc_open()Anna Schumaker2017-01-301-4/+1
| | | | | | It's simpler just to return the status unconditionally Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Return errors directly in _nfs4_opendata_reclaim_to_nfs4_state()Anna Schumaker2017-01-301-8/+3
| | | | | | | There is no need for a goto just to return an error code without any cleanup. Returning the error directly helps to clean up the code. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Remove nfs4_wait_for_completion_rpc_task()Anna Schumaker2017-01-301-15/+7
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Clean up _nfs4_is_integrity_protected()Anna Schumaker2017-01-301-6/+1
| | | | | | | We can cut out the if statement and return the results of the comparison directly. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Fix inconsistent indentation in nfs4proc.cAnna Schumaker2017-01-301-28/+28
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Make trace_nfs4_setup_sequence() available to NFS v4.0Anna Schumaker2017-01-301-3/+1
| | | | | | | | | This tracepoint displays information about the slot that was chosen for the RPC, in addition to session information. This could be useful information for debugging, and we can set the session id hash to 0 to indicate that there is no session. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Merge the remaining setup_sequence functionsAnna Schumaker2017-01-301-67/+20
| | | | | | | This creates a single place for all the work to happen, using the presence of a session to determine if extra values need to be set. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Check if the slot table is draining from nfs4_setup_sequence()Anna Schumaker2017-01-301-14/+9
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Handle setup sequence task rescheduling in a single placeAnna Schumaker2017-01-301-22/+15
| | | | Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Lock the slot table from a single place during setup sequenceAnna Schumaker2017-01-301-13/+12
| | | | | | Rather than implementing this twice for NFS v4.0 and v4.1 Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Move slot-already-allocated check into nfs_setup_sequence()Anna Schumaker2017-01-301-10/+9
| | | | | | | This puts the check in a single place, rather than needing to implement it twice for v4.0 and v4.1. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Create a single nfs4_setup_sequence() functionAnna Schumaker2017-01-301-47/+29
| | | | | | | The inline ifdef lets us put everything in a single place, rather than having two (very similar) versions of this function. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Use nfs4_setup_sequence() everywhereAnna Schumaker2017-01-301-15/+15
| | | | | | | This does the right thing depending on if we have a session, rather than needing to handle this manually in multiple places. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Change nfs4_setup_sequence() to take an nfs_client structureAnna Schumaker2017-01-301-16/+15
| | | | | | | | I want to have all callers use this function, rather than calling the NFS v4.0 and v4.1 versions directly. This includes pNFS, which only has access to the nfs_client structure in some places. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFS: Change nfs4_get_session() to take an nfs_client structureAnna Schumaker2017-01-301-5/+5
| | | | | | | | pNFS only has access to the nfs_client structure, and not the nfs_server, so we need to make this change so the function can be used by pNFS as well. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
* NFSv4.0: always send mode in SETATTR after EXCLUSIVE4Benjamin Coddington2017-01-241-1/+2
| | | | | | | | | | | | Some nfsv4.0 servers may return a mode for the verifier following an open with EXCLUSIVE4 createmode, but this does not mean the client should skip setting the mode in the following SETATTR. It should only do that for EXCLUSIVE4_1 or UNGAURDED createmode. Fixes: 5334c5bdac92 ("NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1") Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Cc: stable@vger.kernel.org # v4.3+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
* NFSv4.1: Fix a deadlock in layoutgetTrond Myklebust2017-01-231-0/+1
| | | | | | | | | | | We cannot call nfs4_handle_exception() without first ensuring that the slot has been freed. If not, we end up deadlocking with the process waiting for recovery to complete, and recovery waiting for the slot table to drain. Fixes: 2e80dbe7ac51 ("NFSv4.1: Close callback races for OPEN, LAYOUTGET...") Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
* NFSv4: update_changeattr should update the attribute timestampTrond Myklebust2017-01-121-8/+13
| | | | | | Otherwise, the attribute cache remains marked as being expired. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
* NFSv4: Don't call update_changeattr() unless the unlink is successfulTrond Myklebust2017-01-121-1/+2
| | | | | | | If the unlink wasn't successful, then the directory has presumably not changed. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
* NFSv4: Don't apply change_info4 twice on rename within a directoryTrond Myklebust2017-01-121-2/+5
| | | | | | | | 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>
* NFSv4: Call update_changeattr() from _nfs4_proc_open only if a file was createdTrond Myklebust2017-01-121-1/+2
| | | | | | | | 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>
* nfs: Don't take a reference on fl->fl_file for LOCK operationBenjamin Coddington2017-01-121-3/+0
| | | | | | | | | | | | | | | | | 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>
* NFSv4: Retry the DELEGRETURN if the embedded GETATTR is rejected with EACCESTrond Myklebust2016-12-191-0/+8
| | | | | | | | | 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>
* NFS: Retry the CLOSE if the embedded GETATTR is rejected with EACCESTrond Myklebust2016-12-191-0/+10
| | | | | | | | | 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>
* NFSv4: Place the GETATTR operation before the CLOSETrond Myklebust2016-12-191-2/+6
| | | | | | | | 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>
* NFSv4: Also ask for attributes when downgrading to a READ-only stateTrond Myklebust2016-12-191-1/+2
| | | | | | | | | 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>
* NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURNTrond Myklebust2016-12-191-4/+1
| | | | | | | | | 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>
* NFSv4: Update the attribute cache info in update_changeattrTrond Myklebust2016-12-191-1/+8
| | | | | | | | | | | | | | 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>
* nfs: add support for the umask attributeAndreas Gruenbacher2016-12-091-4/+12
| | | | | | | | | | | | | 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>
* pNFS: Layoutreturn must free the layout after the layout-private dataTrond Myklebust2016-12-071-2/+2
| | | | | | | | | | 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>
* NFSv4: Add missing nfs_put_lock_context()NeilBrown2016-12-071-2/+4
| | | | | | | | | 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>
* NFSv4.1: Handle NFS4ERR_BADSESSION/NFS4ERR_DEADSESSION replies to OP_SEQUENCETrond Myklebust2016-12-041-0/+4
| | | | | | | | 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>
* pNFS: Allow layout drivers to manage private data in struct nfs4_layoutreturnTrond Myklebust2016-12-021-0/+6
| | | | | | | Cleanup to allow layout drivers to attach private data to layoutreturn, and manage the data. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
* NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of ↵NeilBrown2016-12-011-9/+6
| | | | | | | | | | | | | | | 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>
* NFSv4: change nfs4_do_setattr to take an open_context instead of a nfs4_state.NeilBrown2016-12-011-15/+13
| | | | | | | | | | | 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>
* NFSv4: add flock_owner to open contextNeilBrown2016-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* NFS: remove l_pid field from nfs_lockownerNeilBrown2016-12-011-1/+0
| | | | | | | | | | | | | | | | | | 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>
* pNFS: Prevent unnecessary layoutreturns after delegreturnTrond Myklebust2016-12-011-2/+4
| | | | | | | | | | | | 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>
* pNFS: Enable layoutreturn operation for return-on-closeTrond Myklebust2016-12-011-25/+20
| | | | | | | | | | 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>
OpenPOWER on IntegriCloud