[PATCH] target/user: Disallow pass_level=0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



TCMU requires more work to correctly handle both user handlers that want
all SCSI commands (pass_level=0) for a se_device, and also handlers that
just want I/O commands and let the others be emulated by the kernel
(pass_level=1).

Right now, TCMU is doing the right thing for level=1, but attributes and
transport_type are wrong for level=0. Do not allow it to be used for now.
We can resolve the issues and then enable it when it's ready.

The ABI break for TCMU v2 is already applied for this release, so it's
best to include this now to avoid another ABI break in the future.

Reported-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 drivers/target/target_core_user.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 1e6b20b..c314563 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -879,6 +879,16 @@ static int tcmu_configure_device(struct se_device *dev)
 
 	info = &udev->uio_info;
 
+	/*
+	 * TODO: We need correct attribs and transport_type for pass_level=0.
+	 * Disable it for now so nobody relies on broken behavior while
+	 * we work on a fix.
+	 */
+	if (udev->pass_level != TCMU_PASS_IO) {
+		pr_err("TCMU: Only pass_level=1 supported for now\n");
+		return -EINVAL;
+	}
+
 	size = snprintf(NULL, 0, "tcm-user/%u/%s/%s", hba->host_id, udev->name,
 			udev->dev_config);
 	size += 1; /* for \0 */
-- 
2.1.0

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




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux