1. 01 6月, 2018 9 次提交
  2. 09 3月, 2018 1 次提交
  3. 15 1月, 2018 2 次提交
    • S
      nfs/pnfs: fix nfs_direct_req ref leak when i/o falls back to the mds · ba4a76f7
      Scott Mayhew 提交于
      Currently when falling back to doing I/O through the MDS (via
      pnfs_{read|write}_through_mds), the client frees the nfs_pgio_header
      without releasing the reference taken on the dreq
      via pnfs_generic_pg_{read|write}pages -> nfs_pgheader_init ->
      nfs_direct_pgio_init.  It then takes another reference on the dreq via
      nfs_generic_pg_pgios -> nfs_pgheader_init -> nfs_direct_pgio_init and
      as a result the requester will become stuck in inode_dio_wait.  Once
      that happens, other processes accessing the inode will become stuck as
      well.
      
      Ensure that pnfs_read_through_mds() and pnfs_write_through_mds() clean
      up correctly by calling hdr->completion_ops->completion() instead of
      calling hdr->release() directly.
      
      This can be reproduced (sometimes) by performing "storage failover
      takeover" commands on NetApp filer while doing direct I/O from a client.
      
      This can also be reproduced using SystemTap to simulate a failure while
      doing direct I/O from a client (from Dave Wysochanski
      <dwysocha@redhat.com>):
      
      stap -v -g -e 'probe module("nfs_layout_nfsv41_files").function("nfs4_fl_prepare_ds").return { $return=NULL; exit(); }'
      Suggested-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Fixes: 1ca018d2 ("pNFS: Fix a memory leak when attempted pnfs fails")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      ba4a76f7
    • B
      pnfs/blocklayout: handle transient devices · b3dce6a2
      Benjamin Coddington 提交于
      PNFS block/SCSI layouts should gracefully handle cases where block devices
      are not available when a layout is retrieved, or the block devices are
      removed while the client holds a layout.
      
      While setting up a layout segment, keep a record of an unavailable or
      un-parsable block device in cache with a flag so that subsequent layouts do
      not spam the server with GETDEVINFO.  We can reuse the current
      NFS_DEVICEID_UNAVAILABLE handling with one variation: instead of reusing
      the device, we will discard it and send a fresh GETDEVINFO after the
      timeout, since the lookup and validation of the device occurs within the
      GETDEVINFO response handling.
      
      A lookup of a layout segment that references an unavailable device will
      return a segment with the NFS_LSEG_UNAVAILABLE flag set.  This will allow
      the pgio layer to mark the layout with the appropriate fail bit, which
      forces subsequent IO to the MDS, and prevents spamming the server with
      LAYOUTGET, LAYOUTRETURN.
      
      Finally, when IO to a block device fails, look up the block device(s)
      referenced by the pgio header, and mark them as unavailable.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b3dce6a2
  4. 18 11月, 2017 4 次提交
  5. 12 9月, 2017 1 次提交
  6. 09 9月, 2017 1 次提交
    • T
      NFS: Fix 2 use after free issues in the I/O code · 196639eb
      Trond Myklebust 提交于
      The writeback code wants to send a commit after processing the pages,
      which is why we want to delay releasing the struct path until after
      that's done.
      
      Also, the layout code expects that we do not free the inode before
      we've put the layout segments in pnfs_writehdr_free() and
      pnfs_readhdr_free()
      
      Fixes: 919e3bd9 ("NFS: Ensure we commit after writeback is complete")
      Fixes: 4714fb51 ("nfs: remove pgio_header refcount, related cleanup")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      196639eb
  7. 15 8月, 2017 1 次提交
  8. 24 5月, 2017 1 次提交
    • B
      pnfs: Fix the check for requests in range of layout segment · 08cb5b0f
      Benjamin Coddington 提交于
      It's possible and acceptable for NFS to attempt to add requests beyond the
      range of the current pgio->pg_lseg, a case which should be caught and
      limited by the pg_test operation.  However, the current handling of this
      case replaces pgio->pg_lseg with a new layout segment (after a WARN) within
      that pg_test operation.  That will cause all the previously added requests
      to be submitted with this new layout segment, which may not be valid for
      those requests.
      
      Fix this problem by only returning zero for the number of bytes to coalesce
      from pg_test for this case which allows any previously added requests to
      complete on the current layout segment.  The check for requests starting
      out of range of the layout segment moves to pg_init, so that the
      replacement of pgio->pg_lseg will be done when the next request is added.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      08cb5b0f
  9. 03 5月, 2017 2 次提交
    • T
      pNFS: Fix a deadlock when coalescing writes and returning the layout · 61f454e3
      Trond Myklebust 提交于
      Consider the following deadlock:
      
      Process P1	Process P2		Process P3
      ==========	==========		==========
      					lock_page(page)
      
      		lseg = pnfs_update_layout(inode)
      
      lo = NFS_I(inode)->layout
      pnfs_error_mark_layout_for_return(lo)
      
      		lock_page(page)
      
      					lseg = pnfs_update_layout(inode)
      
      In this scenario,
      - P1 has declared the layout to be in error, but P2 holds a reference to
        a layout segment on that inode, so the layoutreturn is deferred.
      - P2 is waiting for a page lock held by P3.
      - P3 is asking for a new layout segment, but is blocked waiting
        for the layoutreturn.
      
      The fix is to ensure that pnfs_error_mark_layout_for_return() does
      not set the NFS_LAYOUT_RETURN flag, which blocks P3. Instead, we allow
      the latter to call LAYOUTGET so that it can make progress and unblock
      P2.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      61f454e3
    • T
      pNFS: Don't clear the layout return info if there are segments to return · 5466d214
      Trond Myklebust 提交于
      In pnfs_clear_layoutreturn_info, ensure that we don't clear the layout
      return info if there are new segments queued for return due to, for
      instance, a race between a LAYOUTRETURN and a failed I/O attempt.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      5466d214
  10. 29 4月, 2017 3 次提交
  11. 26 4月, 2017 1 次提交
  12. 25 4月, 2017 1 次提交
  13. 21 4月, 2017 1 次提交
  14. 27 1月, 2017 1 次提交
  15. 20 12月, 2016 1 次提交
  16. 06 12月, 2016 1 次提交
  17. 04 12月, 2016 1 次提交
  18. 03 12月, 2016 1 次提交
  19. 02 12月, 2016 7 次提交