1. 12 3月, 2011 3 次提交
    • F
      pnfs: fix pnfs lock inversion of i_lock and cl_lock · f49f9baa
      Fred Isaman 提交于
      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: NFred Isaman <iisaman@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f49f9baa
    • F
      pnfs: do not need to clear NFS_LAYOUT_BULK_RECALL flag · 9f52c252
      Fred Isaman 提交于
      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: NFred Isaman <iisaman@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9f52c252
    • F
      pnfs: avoid incorrect use of layout stateid · 38511722
      Fred Isaman 提交于
      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: NFred Isaman <iisaman@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      38511722
  2. 26 1月, 2011 1 次提交
  3. 07 1月, 2011 11 次提交
  4. 25 10月, 2010 6 次提交