[stgt] [PATCH 01/14] tgt: Don't interfere with internal OSD affairs

Boaz Harrosh bharrosh at panasas.com
Mon Feb 23 18:49:05 CET 2009


Short:
* osd.c has no real knowledge of OSD CDB structure. Let back-store
  sort out CDB errors properly.

Long:
* OSD2's CDB size has changed, in fact there are more then one variant.
* The return code and sense structure was wrong for OSD which have more
  specific error descriptions.
* We might support all versions of OSD, dynamically at run time.
* This code was a layering violation and an ugly hack with it's hard coded
  constant numbers.

Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
---
 usr/osd.c |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/usr/osd.c b/usr/osd.c
index 593cea8..d81c6cf 100644
--- a/usr/osd.c
+++ b/usr/osd.c
@@ -20,36 +20,18 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA
  */
-#include <errno.h>
 #include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 
 #include "list.h"
-#include "util.h"
 #include "tgtd.h"
-#include "tgtadm_error.h"
-#include "target.h"
-#include "driver.h"
 #include "scsi.h"
 #include "spc.h"
 #include "tgtadm_error.h"
 
 static int osd_varlen_cdb(int host_no, struct scsi_cmd *cmd)
 {
-	if (cmd->scb[7] != 200 - 8) {
-		eprintf("request size %d wrong, should be 200\n",
-			cmd->scb[7] + 8);
-		sense_data_build(cmd, ILLEGAL_REQUEST, ASC_LUN_NOT_SUPPORTED);
-		scsi_set_in_resid_by_actual(cmd, 0);
-		scsi_set_out_resid_by_actual(cmd, 0);
-		return SAM_STAT_CHECK_CONDITION;
-	}
-
 	cmd->scsi_cmd_done = target_cmd_io_done;
-
-/* 	return SAM_STAT_GOOD; */
 	return cmd->dev->bst->bs_cmd_submit(cmd);
 }
 
-- 
1.6.0.6

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



More information about the stgt mailing list