1. 11 Mar, 2011 9 commits
    • Fred Isaman's avatar
      pnfs: fix pnfs lock inversion of i_lock and cl_lock · f49f9baa
      Fred Isaman authored
      The pnfs code was using throughout the lock order i_lock, cl_lock.
      This conflicts with the nfs delegation code.  Rework the pnfs code
      to avoid taking both locks simultaneously.
      
      Currently the code takes the double lock to add/remove the layout to a
      nfs_client list, while atomically checking that the list of lsegs is
      empty.  To avoid this, we rely on existing serializations.  When a
      layout is initialized with lseg count equal zero, LAYOUTGET's
      openstateid serialization is in effect, making it safe to assume it
      stays zero unless we change it.  And once a layout's lseg count drops
      to zero, it is set as DESTROYED and so will stay at zero.
      Signed-off-by: default avatarFred Isaman <iisaman@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      f49f9baa
    • Fred Isaman's avatar
      pnfs: do not need to clear NFS_LAYOUT_BULK_RECALL flag · 9f52c252
      Fred Isaman authored
      We do not need to clear the NFS_LAYOUT_BULK_RECALL, as setting it
      guarantees that NFS_LAYOUT_DESTROYED will be set once any outstanding
      io is finished.
      Signed-off-by: default avatarFred Isaman <iisaman@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      9f52c252
    • Fred Isaman's avatar
      pnfs: avoid incorrect use of layout stateid · 38511722
      Fred Isaman authored
      The code could violate the following from RFC5661, section 12.5.3:
      "Once a client has no more layouts on a file, the layout stateid is no
      longer valid and MUST NOT be used."
      
      This can occur when a layout already has a lseg, starts another
      non-everlapping LAYOUTGET, and a CB_LAYOUTRECALL for the existing lseg
      is processed before we hit pnfs_layout_process().
      
      Solve by setting, each time the client has no more lsegs for a file, a
      flag which blocks further use of the layout and triggers its removal.
      
      This also fixes a second bug which occurs in the same instance as
      above.  If we actually use pnfs_layout_process, we add the new lseg to
      the layout, but the layout has been removed from the nfs_client list
      by the intervening CB_LAYOUTRECALL and will not be added back.  Thus
      the newly acquired lseg will not be properly returned in the event of
      a subsequent CB_LAYOUTRECALL.
      Signed-off-by: default avatarFred Isaman <iisaman@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      38511722
    • Chuck Lever's avatar
      NFS: NFSROOT should default to "proto=udp" · 53d47375
      Chuck Lever authored
      There have been a number of recent reports that NFSROOT is no longer
      working with default mount options, but fails only with certain NICs.
      
      Brian Downing <bdowning@lavos.net> bisected to commit 56463e50 "NFS:
      Use super.c for NFSROOT mount option parsing".  Among other things,
      this commit changes the default mount options for NFSROOT to use TCP
      instead of UDP as the underlying transport.
      
      TCP seems less able to deal with NICs that are slow to initialize.
      The system logs that have accompanied reports of problems all show
      that NFSROOT attempts to establish a TCP connection before the NIC is
      fully initialized, and thus the TCP connection attempt fails.
      
      When a TCP connection attempt fails during a mount operation, the
      NFS stack needs to fail the operation.  Usually user space knows how
      and when to retry it.  The network layer does not report a distinct
      error code for this particular failure mode.  Thus, there isn't a
      clean way for the RPC client to see that it needs to retry in this
      case, but not in others.
      
      Because NFSROOT is used in some environments where it is not possible
      to update the kernel command line to specify "udp", the proper thing
      to do is change NFSROOT to use UDP by default, as it did before commit
      56463e50.
      
      To make it easier to see how to change default mount options for
      NFSROOT and to distinguish default settings from mandatory settings,
      I've adjusted a couple of areas to document the specifics.
      
      root_nfs_cat() is also modified to deal with commas properly when
      concatenating strings containing mount option lists.  This keeps
      root_nfs_cat() call sites simpler, now that we may be concatenating
      multiple mount option strings.
      Tested-by: default avatarBrian Downing <bdowning@lavos.net>
      Tested-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Cc: <stable@kernel.org> # 2.6.37
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      53d47375
    • Huang Weiyi's avatar
      nfs4: remove duplicated #include · 57df216b
      Huang Weiyi authored
      Remove duplicated #include('s) in
        fs/nfs/nfs4proc.c
      Signed-off-by: default avatarHuang Weiyi <weiyi.huang@gmail.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      57df216b
    • Trond Myklebust's avatar
      NFSv4: nfs4_state_mark_reclaim_nograce() should be static · f9feab1e
      Trond Myklebust authored
      There are no more external users of nfs4_state_mark_reclaim_nograce() or
      nfs4_state_mark_reclaim_reboot(), so mark them as static.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      f9feab1e
    • Trond Myklebust's avatar
      ecac799a
    • Trond Myklebust's avatar
      NFSv4.1: Fix the handling of the SEQUENCE status bits · b4410c2f
      Trond Myklebust authored
      We want SEQUENCE status bits to be handled by the state manager in order
      to avoid threading issues.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      b4410c2f
    • Trond Myklebust's avatar
      NFSv4/4.1: Fix nfs4_schedule_state_recovery abuses · 0400a6b0
      Trond Myklebust authored
      nfs4_schedule_state_recovery() should only be used when we need to force
      the state manager to check the lease. If we just want to start the
      state manager in order to handle a state recovery situation, we should be
      using nfs4_schedule_state_manager().
      
      This patch fixes the abuses of nfs4_schedule_state_recovery() by replacing
      its use with a set of helper functions that do the right thing.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      0400a6b0
  2. 10 Mar, 2011 10 commits
  3. 07 Mar, 2011 2 commits
  4. 06 Mar, 2011 3 commits
  5. 05 Mar, 2011 16 commits