Thread (36 messages) flat view 36 messages, 2 authors, 2021-07-22

Re: [PATCH 01/24] bsg: remove support for SCSI_IOCTL_SEND_COMMAND

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-07-22 17:31:21
Also in: linux-scsi

On 7/11/21 10:47 PM, Christoph Hellwig wrote:
quoted hunk ↗ jump to hunk
SCSI_IOCTL_SEND_COMMAND has been deprecated longer than bsg exists
and has been warning for just as long.  More importantly it harcodes
SCSI CDBs and thus will do the wrong thing on non-scsi bsg nodes.

Fixes: aa387cc89567 ("block: add bsg helper library")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
  block/bsg.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/bsg.c b/block/bsg.c
index 1f196563ae6c..79b42c5cafeb 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -373,10 +373,13 @@ static long bsg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  	case SG_GET_RESERVED_SIZE:
  	case SG_SET_RESERVED_SIZE:
  	case SG_EMULATED_HOST:
-	case SCSI_IOCTL_SEND_COMMAND:
  		return scsi_cmd_ioctl(bd->queue, NULL, file->f_mode, cmd, uarg);
  	case SG_IO:
  		return bsg_sg_io(bd->queue, file->f_mode, uarg);
+	case SCSI_IOCTL_SEND_COMMAND:
+		pr_warn_ratelimited("%s: calling unsupported SCSI_IOCTL_SEND_COMMAND\n",
+				current->comm);
+		return -EINVAL;
  	default:
  		return -ENOTTY;
  	}
The Fixes: tag will cause this patch to be backported to stable trees. 
Is that intentional?

Anyway:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help