Print this page
8040 NFSv4 client: 3-way deadlock between nfs4_bio(), nfs4_do_delegreturn(), and nfs4_flush_pages()
Reviewed by: Arne Jansen <arne@die-jansens.de>
Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_vnops.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_vnops.c
↓ open down ↓ 2588 lines elided ↑ open up ↑
2589 2589           *
2590 2590           * We don't have to worry about calling 'open_stream_rele'
2591 2591           * since we our currently holding a reference to the open
2592 2592           * stream which means the count cannot go to 0 with this
2593 2593           * decrement.
2594 2594           */
2595 2595          ASSERT(osp->os_ref_count >= 2);
2596 2596          osp->os_ref_count--;
2597 2597  
2598 2598          if (ep->error == 0) {
2599      -                /*
2600      -                 * Avoid a deadlock with the r_serial thread waiting for
2601      -                 * os_sync_lock in nfs4_get_otw_cred_by_osp() which might be
2602      -                 * held by us. We will wait in nfs4_attr_cache() for the
2603      -                 * completion of the r_serial thread.
2604      -                 */
2605 2599                  mutex_exit(&osp->os_sync_lock);
2606 2600                  *have_sync_lockp = 0;
2607 2601  
2608 2602                  nfs4_attr_cache(vp,
2609 2603                      &res.array[1].nfs_resop4_u.opgetattr.ga_res,
2610 2604                      t, cred_otw, TRUE, NULL);
2611 2605          }
2612 2606  
2613 2607          NFS4_DEBUG(nfs4_client_state_debug, (CE_NOTE, "nfs4close_otw:"
2614 2608              " returning %d", ep->error));
↓ open down ↓ 13394 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX