Print this page
4738 tape block number is set at wrong place
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>


1117                                 break;
1118                         }
1119                 } else {
1120                         /* local backup/restore error */
1121                         if ((lcmd = nlp->nlp_cmds.tcs_command) != NULL) {
1122                                 if (lcmd->tc_reader == TLM_STOP ||
1123                                     lcmd->tc_reader == TLM_ABORT ||
1124                                     lcmd->tc_writer == TLM_STOP ||
1125                                     lcmd->tc_writer == TLM_ABORT) {
1126                                         NDMP_LOG(LOG_ERR,
1127                                             "Local data connection terminated");
1128                                         break;
1129                                 }
1130                         }
1131                 }
1132 
1133                 (void) cond_wait(&nlp->nlp_cv, &nlp->nlp_mtx);
1134         }
1135         (void) mutex_unlock(&nlp->nlp_mtx);
1136 
1137         if (session->ns_mover.md_state == NDMP_MOVER_STATE_ACTIVE) {
1138                 session->ns_tape.td_record_count = 0;
1139                 return (0);
1140         }
1141 
1142         return (-1);
1143 }
1144 
1145 /*
1146  * is_buffer_erroneous
1147  *
1148  * Run a sanity check on the buffer
1149  *
1150  * returns:
1151  *   TRUE: if the buffer seems to have error
1152  *   FALSE: if the buffer is full and has valid data.
1153  */
1154 boolean_t
1155 is_buffer_erroneous(tlm_buffer_t *buf)
1156 {
1157         boolean_t rv;
1158 
1159         rv = (buf == NULL || buf->tb_eot || buf->tb_eof ||
1160             buf->tb_errno != 0);
1161         if (rv) {
1162                 if (buf == NULL) {




1117                                 break;
1118                         }
1119                 } else {
1120                         /* local backup/restore error */
1121                         if ((lcmd = nlp->nlp_cmds.tcs_command) != NULL) {
1122                                 if (lcmd->tc_reader == TLM_STOP ||
1123                                     lcmd->tc_reader == TLM_ABORT ||
1124                                     lcmd->tc_writer == TLM_STOP ||
1125                                     lcmd->tc_writer == TLM_ABORT) {
1126                                         NDMP_LOG(LOG_ERR,
1127                                             "Local data connection terminated");
1128                                         break;
1129                                 }
1130                         }
1131                 }
1132 
1133                 (void) cond_wait(&nlp->nlp_cv, &nlp->nlp_mtx);
1134         }
1135         (void) mutex_unlock(&nlp->nlp_mtx);
1136 
1137         return ((session->ns_mover.md_state == NDMP_MOVER_STATE_ACTIVE) ?
1138             0 : -1);




1139 }
1140 
1141 /*
1142  * is_buffer_erroneous
1143  *
1144  * Run a sanity check on the buffer
1145  *
1146  * returns:
1147  *   TRUE: if the buffer seems to have error
1148  *   FALSE: if the buffer is full and has valid data.
1149  */
1150 boolean_t
1151 is_buffer_erroneous(tlm_buffer_t *buf)
1152 {
1153         boolean_t rv;
1154 
1155         rv = (buf == NULL || buf->tb_eot || buf->tb_eof ||
1156             buf->tb_errno != 0);
1157         if (rv) {
1158                 if (buf == NULL) {