Print this page
5981 Deadlock in dmu_objset_find_dp

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dsl_pool.c
          +++ new/usr/src/uts/common/fs/zfs/dsl_pool.c
↓ open down ↓ 1038 lines elided ↑ open up ↑
1039 1039           *
1040 1040           * (Unlike a rwlock, which knows that N threads hold it for
1041 1041           * read, but not *which* threads, so rw_held(RW_READER) returns TRUE
1042 1042           * if any thread holds it for read, even if this thread doesn't).
1043 1043           */
1044 1044          ASSERT(!rrw_held(&dp->dp_config_rwlock, RW_READER));
1045 1045          rrw_enter(&dp->dp_config_rwlock, RW_READER, tag);
1046 1046  }
1047 1047  
1048 1048  void
     1049 +dsl_pool_config_enter_prio(dsl_pool_t *dp, void *tag)
     1050 +{
     1051 +        ASSERT(!rrw_held(&dp->dp_config_rwlock, RW_READER));
     1052 +        rrw_enter_read_prio(&dp->dp_config_rwlock, tag);
     1053 +}
     1054 +
     1055 +void
1049 1056  dsl_pool_config_exit(dsl_pool_t *dp, void *tag)
1050 1057  {
1051 1058          rrw_exit(&dp->dp_config_rwlock, tag);
1052 1059  }
1053 1060  
1054 1061  boolean_t
1055 1062  dsl_pool_config_held(dsl_pool_t *dp)
1056 1063  {
1057 1064          return (RRW_LOCK_HELD(&dp->dp_config_rwlock));
1058 1065  }
1059 1066  
1060 1067  boolean_t
1061 1068  dsl_pool_config_held_writer(dsl_pool_t *dp)
1062 1069  {
1063 1070          return (RRW_WRITE_HELD(&dp->dp_config_rwlock));
1064 1071  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX