1. 06 8月, 2016 1 次提交
  2. 25 6月, 2016 1 次提交
    • O
      nfs4: Fix potential use after free of state in nfs4_do_reclaim. · cea7f829
      Oleg Drokin 提交于
      Commit e8d975e7 ("fixing infinite OPEN loop in 4.0 stateid recovery")
      introduced access to state after it was just potentially freed by
      nfs4_put_open_state leading to a random data corruption somewhere.
      
      BUG: unable to handle kernel paging request at ffff88004941ee40
      IP: [<ffffffff813baf01>] nfs4_do_reclaim+0x461/0x740
      PGD 3501067 PUD 3504067 PMD 6ff37067 PTE 800000004941e060
      Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
      Modules linked in: loop rpcsec_gss_krb5 acpi_cpufreq tpm_tis joydev i2c_piix4 pcspkr tpm virtio_console nfsd ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops floppy serio_raw virtio_blk drm
      CPU: 6 PID: 2161 Comm: 192.168.10.253- Not tainted 4.7.0-rc1-vm-nfs+ #112
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      task: ffff8800463dcd00 ti: ffff88003ff48000 task.ti: ffff88003ff48000
      RIP: 0010:[<ffffffff813baf01>]  [<ffffffff813baf01>] nfs4_do_reclaim+0x461/0x740
      RSP: 0018:ffff88003ff4bd68  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffffffff81a49900 RCX: 00000000000000e8
      RDX: 00000000000000e8 RSI: ffff8800418b9930 RDI: ffff880040c96c88
      RBP: ffff88003ff4bdf8 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffff880040c96c98
      R13: ffff88004941ee20 R14: ffff88004941ee40 R15: ffff88004941ee00
      FS:  0000000000000000(0000) GS:ffff88006d000000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffff88004941ee40 CR3: 0000000060b0b000 CR4: 00000000000006e0
      Stack:
       ffffffff813baad5 ffff8800463dcd00 ffff880000000001 ffffffff810e6b68
       ffff880043ddbc88 ffff8800418b9800 ffff8800418b98c8 ffff88004941ee48
       ffff880040c96c90 ffff880040c96c00 ffff880040c96c20 ffff880040c96c40
      Call Trace:
       [<ffffffff813baad5>] ? nfs4_do_reclaim+0x35/0x740
       [<ffffffff810e6b68>] ? trace_hardirqs_on_caller+0x128/0x1b0
       [<ffffffff813bb7cd>] nfs4_run_state_manager+0x5ed/0xa40
       [<ffffffff813bb1e0>] ? nfs4_do_reclaim+0x740/0x740
       [<ffffffff813bb1e0>] ? nfs4_do_reclaim+0x740/0x740
       [<ffffffff810af0d1>] kthread+0x101/0x120
       [<ffffffff810e6b68>] ? trace_hardirqs_on_caller+0x128/0x1b0
       [<ffffffff818843af>] ret_from_fork+0x1f/0x40
       [<ffffffff810aefd0>] ? kthread_create_on_node+0x250/0x250
      Code: 65 80 4c 8b b5 78 ff ff ff e8 fc 88 4c 00 48 8b 7d 88 e8 13 67 d2 ff 49 8b 47 40 a8 02 0f 84 d3 01 00 00 4c 89 ff e8 7f f9 ff ff <f0> 41 80 26 7f 48 8b 7d c8 e8 b1 84 4c 00 e9 39 fd ff ff 3d e6
      RIP  [<ffffffff813baf01>] nfs4_do_reclaim+0x461/0x740
       RSP <ffff88003ff4bd68>
      CR2: ffff88004941ee40
      Signed-off-by: NOleg Drokin <green@linuxhacker.ru>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      cea7f829
  3. 28 5月, 2016 1 次提交
    • L
      nfs: fix anonymous member initializer build failure with older compilers · e0714ec4
      Linus Torvalds 提交于
      Older versions of gcc don't understand named initializers inside a
      anonymous structure or union member.  It can be worked around by adding
      the bracin gin the initializer for the anonymous member.
      
      Without this, gcc 4.4.4 will fail the build with
      
          CC      fs/nfs/nfs4state.o
        fs/nfs/nfs4state.c:69: error: unknown field ‘data’ specified in initializer
        fs/nfs/nfs4state.c:69: warning: missing braces around initializer
        fs/nfs/nfs4state.c:69: warning: (near initialization for ‘zero_stateid.<anonymous>.data’)
        make[2]: *** [fs/nfs/nfs4state.o] Error 1
      
      introduced in commit 93b717fd ("NFSv4: Label stateids with the type")
      Reported-and-tested-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Anna Schumaker <Anna.Schumaker@netapp.com>
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e0714ec4
  4. 18 5月, 2016 2 次提交
  5. 03 10月, 2015 1 次提交
    • T
      NFSv4: Don't try to reclaim unused state owners · 4a0954ef
      Trond Myklebust 提交于
      Currently, we don't test if the state owner is in use before we try to
      recover it. The problem is that if the refcount is zero, then the
      state owner will be waiting on the lru list for garbage collection.
      The expectation in that case is that if you bump the refcount, then
      you must also remove the state owner from the lru list. Otherwise
      the call to nfs4_put_state_owner will corrupt that list by trying
      to add our state owner a second time.
      
      Avoid the whole problem by just skipping state owners that hold no
      state.
      Reported-by: NAndrew W Elble <aweits@rit.edu>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      4a0954ef
  6. 18 9月, 2015 1 次提交
  7. 18 8月, 2015 1 次提交
  8. 06 7月, 2015 3 次提交
  9. 02 6月, 2015 1 次提交
    • T
      NFSv4: Always drain the slot table before re-establishing the lease · 5cae02f4
      Trond Myklebust 提交于
      While the NFSv4.1 code has always drained the slot tables in order to stop
      non-recovery related RPC calls when doing lease recovery, the NFSv4 code
      did not.
      The reason for the difference in behaviour is that NFSv4 does not have
      session state, and so RPC calls can in theory proceed while recovery is
      happening. In practice, however, anything I/O or state related needs to
      wait until recovery is over.
      
      This patch changes the behaviour of NFSv4 to match that of NFSv4.1 so that
      we can simplify the state recovery code by assuming that we do not have to
      deal with races between recovery and ordinary I/O.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      5cae02f4
  10. 01 6月, 2015 1 次提交
    • O
      fixing infinite OPEN loop in 4.0 stateid recovery · e8d975e7
      Olga Kornievskaia 提交于
      Problem: When an operation like WRITE receives a BAD_STATEID, even though
      recovery code clears the RECLAIM_NOGRACE recovery flag before recovering
      the open state, because of clearing delegation state for the associated
      inode, nfs_inode_find_state_and_recover() gets called and it makes the
      same state with RECLAIM_NOGRACE flag again. As a results, when we restart
      looking over the open states, we end up in the infinite loop instead of
      breaking out in the next test of state flags.
      
      Solution: unset the RECLAIM_NOGRACE set because of
      calling of nfs_inode_find_state_and_recover() after returning from calling
      recover_open() function.
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      e8d975e7
  11. 24 4月, 2015 1 次提交
  12. 16 4月, 2015 1 次提交
  13. 04 3月, 2015 2 次提交
  14. 24 1月, 2015 2 次提交
  15. 17 1月, 2015 3 次提交
  16. 29 9月, 2014 2 次提交
    • T
      NFSv4: fix open/lock state recovery error handling · df817ba3
      Trond Myklebust 提交于
      The current open/lock state recovery unfortunately does not handle errors
      such as NFS4ERR_CONN_NOT_BOUND_TO_SESSION correctly. Instead of looping,
      just proceeds as if the state manager is finished recovering.
      This patch ensures that we loop back, handle higher priority errors
      and complete the open/lock state recovery.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      df817ba3
    • T
      NFSv4: Fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails · a4339b7b
      Trond Myklebust 提交于
      If a NFSv4.x server returns NFS4ERR_STALE_CLIENTID in response to a
      CREATE_SESSION or SETCLIENTID_CONFIRM in order to tell us that it rebooted
      a second time, then the client will currently take this to mean that it must
      declare all locks to be stale, and hence ineligible for reboot recovery.
      
      RFC3530 and RFC5661 both suggest that the client should instead rely on the
      server to respond to inelegible open share, lock and delegation reclaim
      requests with NFS4ERR_NO_GRACE in this situation.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      a4339b7b
  17. 25 9月, 2014 1 次提交
  18. 09 9月, 2014 1 次提交
    • J
      nfs: revert "nfs4: queue free_lock_state job submission to nfsiod" · 0c0e0d3c
      Jeff Layton 提交于
      This reverts commit 49a4bda2.
      
      Christoph reported an oops due to the above commit:
      
      generic/089 242s ...[ 2187.041239] general protection fault: 0000 [#1]
      SMP
      [ 2187.042899] Modules linked in:
      [ 2187.044000] CPU: 0 PID: 11913 Comm: kworker/0:1 Not tainted 3.16.0-rc6+ #1151
      [ 2187.044287] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
      [ 2187.044287] Workqueue: nfsiod free_lock_state_work
      [ 2187.044287] task: ffff880072b50cd0 ti: ffff88007a4ec000 task.ti: ffff88007a4ec000
      [ 2187.044287] RIP: 0010:[<ffffffff81361ca6>]  [<ffffffff81361ca6>] free_lock_state_work+0x16/0x30
      [ 2187.044287] RSP: 0018:ffff88007a4efd58  EFLAGS: 00010296
      [ 2187.044287] RAX: 6b6b6b6b6b6b6b6b RBX: ffff88007a947ac0 RCX: 8000000000000000
      [ 2187.044287] RDX: ffffffff826af9e0 RSI: ffff88007b093c00 RDI: ffff88007b093db8
      [ 2187.044287] RBP: ffff88007a4efd58 R08: ffffffff832d3e10 R09: 000001c40efc0000
      [ 2187.044287] R10: 0000000000000000 R11: 0000000000059e30 R12: ffff88007fc13240
      [ 2187.044287] R13: ffff88007fc18b00 R14: ffff88007b093db8 R15: 0000000000000000
      [ 2187.044287] FS:  0000000000000000(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000
      [ 2187.044287] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [ 2187.044287] CR2: 00007f93ec33fb80 CR3: 0000000079dc2000 CR4: 00000000000006f0
      [ 2187.044287] Stack:
      [ 2187.044287]  ffff88007a4efdd8 ffffffff810cc877 ffffffff810cc80d ffff88007fc13258
      [ 2187.044287]  000000007a947af0 0000000000000000 ffffffff8353ccc8 ffffffff82b6f3d0
      [ 2187.044287]  0000000000000000 ffffffff82267679 ffff88007a4efdd8 ffff88007fc13240
      [ 2187.044287] Call Trace:
      [ 2187.044287]  [<ffffffff810cc877>] process_one_work+0x1c7/0x490
      [ 2187.044287]  [<ffffffff810cc80d>] ? process_one_work+0x15d/0x490
      [ 2187.044287]  [<ffffffff810cd569>] worker_thread+0x119/0x4f0
      [ 2187.044287]  [<ffffffff810fbbad>] ? trace_hardirqs_on+0xd/0x10
      [ 2187.044287]  [<ffffffff810cd450>] ? init_pwq+0x190/0x190
      [ 2187.044287]  [<ffffffff810d3c6f>] kthread+0xdf/0x100
      [ 2187.044287]  [<ffffffff810d3b90>] ? __init_kthread_worker+0x70/0x70
      [ 2187.044287]  [<ffffffff81d9873c>] ret_from_fork+0x7c/0xb0
      [ 2187.044287]  [<ffffffff810d3b90>] ? __init_kthread_worker+0x70/0x70
      [ 2187.044287] Code: 0f 1f 44 00 00 31 c0 5d c3 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 8d b7 48 fe ff ff 48 8b 87 58 fe ff ff 48 89 e5 48 8b 40 30 <48> 8b 00 48 8b 10 48 89 c7 48 8b 92 90 03 00 00 ff 52 28 5d c3
      [ 2187.044287] RIP  [<ffffffff81361ca6>] free_lock_state_work+0x16/0x30
      [ 2187.044287]  RSP <ffff88007a4efd58>
      [ 2187.103626] ---[ end trace 0f11326d28e5d8fa ]---
      
      The original reason for this patch was because the fl_release_private
      operation couldn't sleep. With commit ed9814d8 (locks: defer freeing
      locks in locks_delete_lock until after i_lock has been dropped), this is
      no longer a problem so we can revert this patch.
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Tested-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      0c0e0d3c
  19. 16 7月, 2014 1 次提交
    • N
      sched: Remove proliferation of wait_on_bit() action functions · 74316201
      NeilBrown 提交于
      The current "wait_on_bit" interface requires an 'action'
      function to be provided which does the actual waiting.
      There are over 20 such functions, many of them identical.
      Most cases can be satisfied by one of just two functions, one
      which uses io_schedule() and one which just uses schedule().
      
      So:
       Rename wait_on_bit and        wait_on_bit_lock to
              wait_on_bit_action and wait_on_bit_lock_action
       to make it explicit that they need an action function.
      
       Introduce new wait_on_bit{,_lock} and wait_on_bit{,_lock}_io
       which are *not* given an action function but implicitly use
       a standard one.
       The decision to error-out if a signal is pending is now made
       based on the 'mode' argument rather than being encoded in the action
       function.
      
       All instances of the old wait_on_bit and wait_on_bit_lock which
       can use the new version have been changed accordingly and their
       action functions have been discarded.
       wait_on_bit{_lock} does not return any specific error code in the
       event of a signal so the caller must check for non-zero and
       interpolate their own error code as appropriate.
      
      The wait_on_bit() call in __fscache_wait_on_invalidate() was
      ambiguous as it specified TASK_UNINTERRUPTIBLE but used
      fscache_wait_bit_interruptible as an action function.
      David Howells confirms this should be uniformly
      "uninterruptible"
      
      The main remaining user of wait_on_bit{,_lock}_action is NFS
      which needs to use a freezer-aware schedule() call.
      
      A comment in fs/gfs2/glock.c notes that having multiple 'action'
      functions is useful as they display differently in the 'wchan'
      field of 'ps'. (and /proc/$PID/wchan).
      As the new bit_wait{,_io} functions are tagged "__sched", they
      will not show up at all, but something higher in the stack.  So
      the distinction will still be visible, only with different
      function names (gds2_glock_wait versus gfs2_glock_dq_wait in the
      gfs2/glock.c case).
      
      Since first version of this patch (against 3.15) two new action
      functions appeared, on in NFS and one in CIFS.  CIFS also now
      uses an action function that makes the same freezer aware
      schedule call as NFS.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Acked-by: David Howells <dhowells@redhat.com> (fscache, keys)
      Acked-by: Steven Whitehouse <swhiteho@redhat.com> (gfs2)
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Steve French <sfrench@samba.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20140707051603.28027.72349.stgit@notabene.brownSigned-off-by: NIngo Molnar <mingo@kernel.org>
      74316201
  20. 13 7月, 2014 2 次提交
    • J
      nfs4: queue free_lock_state job submission to nfsiod · 49a4bda2
      Jeff Layton 提交于
      We got a report of the following warning in Fedora:
      
      BUG: sleeping function called from invalid context at mm/slub.c:969
      in_atomic(): 1, irqs_disabled(): 0, pid: 533, name: bash
      3 locks held by bash/533:
       #0:  (&sp->so_delegreturn_mutex){+.+...}, at: [<ffffffffa033da62>] nfs4_proc_lock+0x262/0x910 [nfsv4]
       #1:  (&nfsi->rwsem){.+.+.+}, at: [<ffffffffa033da6a>] nfs4_proc_lock+0x26a/0x910 [nfsv4]
       #2:  (&sb->s_type->i_lock_key#23){+.+...}, at: [<ffffffff812998dc>] flock_lock_file_wait+0x8c/0x3a0
      CPU: 0 PID: 533 Comm: bash Not tainted 3.15.0-0.rc1.git1.1.fc21.x86_64 #1
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
       0000000000000000 00000000d664ff3c ffff880078b69a70 ffffffff817e82e0
       0000000000000000 ffff880078b69a98 ffffffff810cf1a4 0000000000000050
       0000000000000050 ffff88007cc01a00 ffff880078b69ad8 ffffffff8121449e
      Call Trace:
       [<ffffffff817e82e0>] dump_stack+0x4d/0x66
       [<ffffffff810cf1a4>] __might_sleep+0x184/0x240
       [<ffffffff8121449e>] kmem_cache_alloc_trace+0x4e/0x330
       [<ffffffffa0331124>] ? nfs4_release_lockowner+0x74/0x110 [nfsv4]
       [<ffffffffa0331124>] nfs4_release_lockowner+0x74/0x110 [nfsv4]
       [<ffffffffa0352340>] nfs4_put_lock_state+0x90/0xb0 [nfsv4]
       [<ffffffffa0352375>] nfs4_fl_release_lock+0x15/0x20 [nfsv4]
       [<ffffffff81297515>] locks_free_lock+0x45/0x90
       [<ffffffff8129996c>] flock_lock_file_wait+0x11c/0x3a0
       [<ffffffffa033da6a>] ? nfs4_proc_lock+0x26a/0x910 [nfsv4]
       [<ffffffffa033301e>] do_vfs_lock+0x1e/0x30 [nfsv4]
       [<ffffffffa033da79>] nfs4_proc_lock+0x279/0x910 [nfsv4]
       [<ffffffff810dbb26>] ? local_clock+0x16/0x30
       [<ffffffff810f5a3f>] ? lock_release_holdtime.part.28+0xf/0x200
       [<ffffffffa02f820c>] do_unlk+0x8c/0xc0 [nfs]
       [<ffffffffa02f85c5>] nfs_flock+0xa5/0xf0 [nfs]
       [<ffffffff8129a6f6>] locks_remove_file+0xb6/0x1e0
       [<ffffffff812159d8>] ? kfree+0xd8/0x2d0
       [<ffffffff8123bc63>] __fput+0xd3/0x210
       [<ffffffff8123bdee>] ____fput+0xe/0x10
       [<ffffffff810bfb6d>] task_work_run+0xcd/0xf0
       [<ffffffff81019cd1>] do_notify_resume+0x61/0x90
       [<ffffffff817fbea2>] int_signal+0x12/0x17
      
      The problem is that NFSv4 is trying to do an allocation from
      fl_release_private (in order to send a RELEASE_LOCKOWNER call). That
      function can be called while holding the inode->i_lock, and it's
      currently set up to do __GFP_WAIT allocations. v4.1 code has a
      similar problem.
      
      This patch adds a work_struct to the nfs4_lock_state and has the code
      queue the free_lock_state operation to nfsiod.
      Reported-by: NJosh Stone <jistone@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@poochiereds.net>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      49a4bda2
    • J
      nfs4: treat lock owners as opaque values · 8003d3c4
      Jeff Layton 提交于
      Do the following set of ops with a file on a NFSv4 mount:
      
          exec 3>>/file/on/nfsv4
          flock -x 3
          exec 3>&-
      
      You'll see the LOCK request go across the wire, but no LOCKU when the
      file is closed.
      
      What happens is that the fd is passed across a fork, and the final close
      is done in a different process than the opener. That makes
      __nfs4_find_lock_state miss finding the correct lock state because it
      uses the fl_pid as a search key. A new one is created, and the locking
      code treats it as a delegation stateid (because NFS_LOCK_INITIALIZED
      isn't set).
      
      The root cause of this breakage seems to be commit 77041ed9
      (NFSv4: Ensure the lockowners are labelled using the fl_owner and/or
      fl_pid).
      
      That changed it so that flock lockowners are allocated based on the
      fl_pid. I think this is incorrect. flock locks should be "owned" by the
      struct file, and that is already accounted for in the fl_owner field of
      the lock request when it comes through nfs_flock.
      
      This patch basically reverts the above commit and with it, a LOCKU is
      sent in the above reproducer.
      Signed-off-by: NJeff Layton <jlayton@poochiereds.net>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      8003d3c4
  21. 06 6月, 2014 1 次提交
  22. 18 4月, 2014 1 次提交
  23. 19 3月, 2014 1 次提交
  24. 06 3月, 2014 1 次提交
  25. 20 2月, 2014 1 次提交
  26. 19 2月, 2014 1 次提交
  27. 06 1月, 2014 1 次提交
  28. 15 11月, 2013 1 次提交
  29. 14 11月, 2013 1 次提交
    • J
      nfs: don't retry detect_trunking with RPC_AUTH_UNIX more than once · 6d769f1e
      Jeff Layton 提交于
      Currently, when we try to mount and get back NFS4ERR_CLID_IN_USE or
      NFS4ERR_WRONGSEC, we create a new rpc_clnt and then try the call again.
      There is no guarantee that doing so will work however, so we can end up
      retrying the call in an infinite loop.
      
      Worse yet, we create the new client using rpc_clone_client_set_auth,
      which creates the new client as a child of the old one. Thus, we can end
      up with a *very* long lineage of rpc_clnts. When we go to put all of the
      references to them, we can end up with a long call chain that can smash
      the stack as each rpc_free_client() call can recurse back into itself.
      
      This patch fixes this by simply ensuring that the SETCLIENTID call will
      only be retried in this situation if the last attempt did not use
      RPC_AUTH_UNIX.
      
      Note too that with this change, we don't need the (i > 2) check in the
      -EACCES case since we now have a more reliable test as to whether we
      should reattempt.
      
      Cc: stable@vger.kernel.org # v3.10+
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Tested-by/Acked-by: Weston Andros Adamson <dros@netapp.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6d769f1e
  30. 01 11月, 2013 1 次提交
  31. 29 10月, 2013 1 次提交
    • C
      NFS: Fix possible endless state recovery wait · 0625c2dd
      Chuck Lever 提交于
      In nfs4_wait_clnt_recover(), hold a reference to the clp being
      waited on.  The state manager can reduce clp->cl_count to 1, in
      which case the nfs_put_client() in nfs4_run_state_manager() can
      free *clp before wait_on_bit() returns and allows
      nfs4_wait_clnt_recover() to run again.
      
      The behavior at that point is non-deterministic.  If the waited-on
      bit still happens to be zero, wait_on_bit() will wake the waiter as
      expected.  If the bit is set again (say, if the memory was poisoned
      when freed) wait_on_bit() can leave the waiter asleep.
      
      This is a narrow fix which ensures the safety of accessing *clp in
      nfs4_wait_clnt_recover(), but does not address the continued use
      of a possibly freed *clp after nfs4_wait_clnt_recover() returns
      (see nfs_end_delegation_return(), for example).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0625c2dd