1. 27 9月, 2014 2 次提交
  2. 18 9月, 2014 6 次提交
    • J
      nfsd4: clarify how grace period ends · 70b28235
      J. Bruce Fields 提交于
      The grace period is ended in two steps--first userland is notified that
      the grace period is now long enough that any clients who have not yet
      reclaimed can be safely forgotten, then we flip the switch that forbids
      reclaims and allows new opens.  I had to think a bit to convince myself
      that the ordering was right here.  Document it.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      70b28235
    • J
      nfsd4: stop grace_time update at end of grace period · bea57fe4
      J. Bruce Fields 提交于
      The attempt to automatically set a new grace period time at the end of
      the grace period isn't really helpful.  We'll probably shut down and
      reboot before we actually make use of the new grace period time anyway.
      So may as well leave it up to the init system to get this right.
      
      This just confuses people when they see /proc/fs/nfsd/nfsv4gracetime
      change from what they set it to.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      bea57fe4
    • J
      nfsd: pass extra info in env vars to upcalls to allow for early grace period end · d4318acd
      Jeff Layton 提交于
      In order to support lifting the grace period early, we must tell
      nfsdcltrack what sort of client the "create" upcall is for. We can't
      reliably tell if a v4.0 client has completed reclaiming, so we can only
      lift the grace period once all the v4.1+ clients have issued a
      RECLAIM_COMPLETE and if there are no v4.0 clients.
      
      Also, in order to lift the grace period, we have to tell userland when
      the grace period started so that it can tell whether a RECLAIM_COMPLETE
      has been issued for each client since then.
      
      Since this is all optional info, we pass it along in environment
      variables to the "init" and "create" upcalls. By doing this, we don't
      need to revise the upcall format. The UMH upcall can simply make use of
      this info if it happens to be present. If it's not then it can just
      avoid lifting the grace period early.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      d4318acd
    • J
      nfsd: add a v4_end_grace file to /proc/fs/nfsd · 7f5ef2e9
      Jeff Layton 提交于
      Allow a privileged userland process to end the v4 grace period early.
      Writing "Y", "y", or "1" to the file will cause the v4 grace period to
      be lifted.  The basic idea with this will be to allow the userland
      client tracking program to lift the grace period once it knows that no
      more clients will be reclaiming state.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      7f5ef2e9
    • J
      nfsd: reject reclaim request when client has already sent RECLAIM_COMPLETE · 3b3e7b72
      Jeff Layton 提交于
      As stated in RFC 5661, section 18.51.3:
      
          Once a RECLAIM_COMPLETE is done, there can be no further reclaim
          operations for locks whose scope is defined as having completed
          recovery.  Once the client sends RECLAIM_COMPLETE, the server will
          not allow the client to do subsequent reclaims of locking state for
          that scope and, if these are attempted, will return
          NFS4ERR_NO_GRACE.
      
      Ensure that we enforce that requirement.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      3b3e7b72
    • J
      nfsd: remove redundant boot_time parm from grace_done client tracking op · 919b8049
      Jeff Layton 提交于
      Since it's stored in nfsd_net, we don't need to pass it in separately.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      919b8049
  3. 29 8月, 2014 1 次提交
  4. 18 8月, 2014 2 次提交
    • J
      nfsd: call nfs4_put_deleg_lease outside of state_lock · afbda402
      Jeff Layton 提交于
      Currently, we hold the state_lock when releasing the lease. That's
      potentially problematic in the future if we allow for setlease methods
      that can sleep. Move the nfs4_put_deleg_lease call out of the delegation
      unhashing routine (which was always a bit goofy anyway), and into the
      unlocked sections of the callers of unhash_delegation_locked.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      afbda402
    • J
      nfsd: protect lease-related nfs4_file fields with fi_lock · 6bcc034e
      Jeff Layton 提交于
      Currently these fields are protected with the state_lock, but that
      doesn't really make a lot of sense. These fields are "private" to the
      nfs4_file, and can be protected with the more granular fi_lock.
      
      The fi_lock is already held when setting these fields. Make the code
      hold the fp->fi_lock when clearing the lease-related fields in the
      nfs4_file, and no longer require that the state_lock be held when
      calling into this function.
      
      To prevent lock inversion with the i_lock, we also move the vfs_setlease
      and fput calls outside of the fi_lock. This also sets us up for allowing
      vfs_setlease calls to block in the future.
      
      Finally, remove a redundant NULL pointer check. unhash_delegation_locked
      locks the fp->fi_lock prior to that check, so fp in that function must
      never be NULL.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6bcc034e
  5. 06 8月, 2014 1 次提交
  6. 05 8月, 2014 23 次提交
  7. 02 8月, 2014 5 次提交