Skip to contentSkip to conversation

target: update error handling for sbc_setup_write_same()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 27, 2012 – Nov 28, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: update error handling for sbc_setup_write_same()

We recently changed this to return positive subsystem error codes so the error handling needs to be updated.

drivers/target/target_core_sbc.c +3 -3
index 943c689..4fd22cd 100644
@@ -439,7 +439,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 			cmd->t_task_lba = get_unaligned_be64(&cdb[12]);
 
 			ret = sbc_setup_write_same(cmd, &cdb[10], ops);
-			if (ret < 0)
+			if (ret)
 				return ret;
 			break;
 		default:
@@ -512,7 +512,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 		cmd->t_task_lba = get_unaligned_be64(&cdb[2]);
 
 		ret = sbc_setup_write_same(cmd, &cdb[1], ops);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		break;
 	case WRITE_SAME:
@@ -530,7 +530,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 		 * of byte 1 bit 3 UNMAP instead of original reserved field
 		 */
 		ret = sbc_setup_write_same(cmd, &cdb[1], ops);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		break;
 	case VERIFY:
#1 lore raw

Hi Dan,

Quoted 5 lines · Dan Carpenter

We recently changed this to return positive subsystem error codes so the error handling needs to be updated.

A nice catch on this sense_reason_t return breakage that I managed to introduce within for-3.8 code.

Applied to for-next.

Thank you!

--nab

Quoted 35 lines
drivers/target/target_core_sbc.c +3 -4
index 943c689..4fd22cd 100644
@@ -439,7 +439,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 			cmd->t_task_lba = get_unaligned_be64(&cdb[12]);
 
 			ret = sbc_setup_write_same(cmd, &cdb[10], ops);
-			if (ret < 0)
+			if (ret)
 				return ret;
 			break;
 		default:
@@ -512,7 +512,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 		cmd->t_task_lba = get_unaligned_be64(&cdb[2]);
 
 		ret = sbc_setup_write_same(cmd, &cdb[1], ops);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		break;
 	case WRITE_SAME:
@@ -530,7 +530,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 		 * of byte 1 bit 3 UNMAP instead of original reserved field
 		 */
 		ret = sbc_setup_write_same(cmd, &cdb[1], ops);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		break;
 	case VERIFY:
--

To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html