Date: Fri, 12 Aug 2011 08:28:11 +0000 From: oleksandr@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r225035 - soc2011/oleksandr/oleksandr-head/head/sys/cam Message-ID: <20110812082811.83CDB1065674@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oleksandr Date: Fri Aug 12 08:28:11 2011 New Revision: 225035 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=225035 Log: Review a type of error Modified: soc2011/oleksandr/oleksandr-head/head/sys/cam/cam_periph.c Modified: soc2011/oleksandr/oleksandr-head/head/sys/cam/cam_periph.c ============================================================================== --- soc2011/oleksandr/oleksandr-head/head/sys/cam/cam_periph.c Fri Aug 12 07:04:16 2011 (r225034) +++ soc2011/oleksandr/oleksandr-head/head/sys/cam/cam_periph.c Fri Aug 12 08:28:11 2011 (r225035) @@ -1707,14 +1707,14 @@ */ if (status == CAM_SEL_TIMEOUT || status == CAM_SCSI_BUSY || status == CAM_SIM_QUEUED || status == CAM_FUNC_NOTAVAIL || - status == CAM_REQ_INVALID) + status == CAM_REQ_INVALID || status == CAM_CMD_TIMEOUT) error_flag_ret = DEVSTAT_ERROR_RETRIABLE; /* * If the error is critical refer it to the type of non retry able. */ if (status == CAM_REQ_CMP_ERR || status == CAM_TID_INVALID || status == CAM_SCSI_STATUS_ERROR || status == CAM_AUTOSENSE_FAIL || - status == CAM_LUN_INVALID) + status == CAM_LUN_INVALID || status == CAM_AUTOSNS_VALID) error_flag_ret = DEVSTAT_ERROR_NON_RETRIABLE; /* * If the error is write error refer it to the type of write error. @@ -1727,7 +1727,8 @@ if (ccb->ccb_h.flags == CAM_DIR_IN && error_flag_ret != 0) error_flag_type = DEVSTAT_ERROR_READ_ERROR; /* - * If the request is countrol and there is no action with data * refer it to the type of other error. + * If the request is countrol and there is no action with data + * refer it to the type of other error. */ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE && error_flag_ret != 0) @@ -1737,10 +1738,9 @@ * in devstat and increase the corresponding counter of errors. */ if (error_flag_ret) { - device_error = devstat_search( + if ((device_error = devstat_search( ccb->ccb_h.path->periph->periph_name, - ccb->ccb_h.path->periph->unit_number); - if (device_error != NULL) { + ccb->ccb_h.path->periph->unit_number)) != NULL) { devstat_add_error(device_error, error_flag_ret | error_flag_type); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110812082811.83CDB1065674>