From: Anastasia Kovaleva <a.kovaleva@yadro.com>
To: <martin.petersen@oracle.com>
Cc: <target-devel@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
<linux@yadro.com>, Roman Bolshakov <r.bolshakov@yadro.com>,
Bart Van Assche <bvanassche@acm.org>,
Konstantin Vinogradov <k.vinogradov@yadro.com>
Subject: [RESEND PATCH 1/3] scsi: target: core: Set residuals for 4Kn devices
Date: Thu, 3 Dec 2020 11:20:33 +0300 [thread overview]
Message-ID: <20201203082035.54566-2-a.kovaleva@yadro.com> (raw)
In-Reply-To: <20201203082035.54566-1-a.kovaleva@yadro.com>
From: Roman Bolshakov <r.bolshakov@yadro.com>
TCM always fails SBC commands with residuals for 4Kn devices when the
command is processed by sbc_parse_cdb(). That prevents residual
signalling to the transport driver because residual kind and residual
amount aren't set. It also makes residual handling different from
512-byte formatted devices - if there are residuals 512-byte LUN would
proceed with command execution while 4K-byte LUN would fail.
Based-on: https://patchwork.kernel.org/project/target-devel/patch/20170523234854.21452-31-bart.vanassche@sandisk.com/
Based-on-patch-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Konstantin Vinogradov <k.vinogradov@yadro.com>
---
drivers/target/target_core_transport.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index fca4bd079d02..f27a7d6cc1e0 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1332,17 +1332,6 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
return TCM_INVALID_CDB_FIELD;
}
}
- /*
- * Reject READ_* or WRITE_* with overflow/underflow for
- * type SCF_SCSI_DATA_CDB.
- */
- if (dev->dev_attrib.block_size != 512) {
- pr_err("Failing OVERFLOW/UNDERFLOW for LBA op"
- " CDB on non 512-byte sector setup subsystem"
- " plugin: %s\n", dev->transport->name);
- /* Returns CHECK_CONDITION + INVALID_CDB_FIELD */
- return TCM_INVALID_CDB_FIELD;
- }
/*
* For the overflow case keep the existing fabric provided
* ->data_length. Otherwise for the underflow case, reset
--
2.24.3 (Apple Git-128)
next prev parent reply other threads:[~2020-12-03 8:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 8:20 [RESEND PATCH 0/3] scsi: target: Set correct residual data Anastasia Kovaleva
2020-12-03 8:20 ` Anastasia Kovaleva [this message]
2020-12-03 8:20 ` [RESEND PATCH 2/3] scsi: target: core: Signal WRITE residuals Anastasia Kovaleva
2020-12-03 8:20 ` [RESEND PATCH 3/3] scsi: target: core: Change ASCQ for residual write Anastasia Kovaleva
2021-01-21 15:24 ` [RESEND PATCH 0/3] scsi: target: Set correct residual data Anastasia Kovaleva
2021-01-27 4:12 ` Martin K. Petersen
2021-01-29 19:01 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201203082035.54566-2-a.kovaleva@yadro.com \
--to=a.kovaleva@yadro.com \
--cc=bvanassche@acm.org \
--cc=k.vinogradov@yadro.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.com \
--cc=martin.petersen@oracle.com \
--cc=r.bolshakov@yadro.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).