diff mbox series

[1/5] scsi: target: Remove incorrect zero blocks WRITE_SAME check

Message ID 20220628022953.20948-2-michael.christie@oracle.com (mailing list archive)
State Superseded
Headers show
Series target: UNMAP/WRITE_SAME features/cleanups for 5.20 | expand

Commit Message

Mike Christie June 28, 2022, 2:29 a.m. UTC
We use WSNZ=1 so if we get a WRITE_SAME with zero logical blocks we are
supposed to fail it. We do this check and failure in target_core_sbc.c
before calling into the backend, so we can remove the incorrect check in
target_core_file.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/target/target_core_file.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Christoph Hellwig June 28, 2022, 5:03 a.m. UTC | #1
On Mon, Jun 27, 2022 at 09:29:49PM -0500, Mike Christie wrote:
> We use WSNZ=1 so if we get a WRITE_SAME with zero logical blocks we are
> supposed to fail it. We do this check and failure in target_core_sbc.c
> before calling into the backend, so we can remove the incorrect check in
> target_core_file.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 6c8d8b051bfd..e8440e5dd804 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -438,10 +438,6 @@  fd_execute_write_same(struct se_cmd *cmd)
 	unsigned int len = 0, i;
 	ssize_t ret;
 
-	if (!nolb) {
-		target_complete_cmd(cmd, SAM_STAT_GOOD);
-		return 0;
-	}
 	if (cmd->prot_op) {
 		pr_err("WRITE_SAME: Protection information with FILEIO"
 		       " backends not supported\n");