Skip to contentSkip to conversation

Remove the tcm_fc driver

PATCH In review Bart Van Assche 2 participants 2 messages Jan 11, 2021 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove the tcm_fc driver

Since its introduction in 2011, the tcm_fc driver processes SCSI read commands as follows if the number of remaining bytes is a multiple of four:
- Queue data by calling fc_seq_send(). The FCoE driver translates that call into a dev_queue_xmit(skb) call which sends the data asynchronously.
- After having queued the data for sending, free the data buffer synchronously from inside ft_queue_status().

This race condition can be triggered by running fio --verify against the FCoE initiator driver. Since this bug causes data corruption and since nobody has reported this bug since the tcm_fc driver went upstream, this is a strong indication that the tcm_fc driver is not being used. Hence remove this driver from the kernel tree.

Cc Kiran Patil <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Mike Christie <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Yi Zou <[email protected]>
---
 drivers/target/Kconfig           |   1 -
 drivers/target/Makefile          |   1 -
 drivers/target/tcm_fc/Kconfig    |   6 -
 drivers/target/tcm_fc/Makefile   |   7 -
 drivers/target/tcm_fc/tcm_fc.h   | 169 ----------
 drivers/target/tcm_fc/tfc_cmd.c  | 561 -------------------------------
 drivers/target/tcm_fc/tfc_conf.c | 491 ---------------------------
 drivers/target/tcm_fc/tfc_io.c   | 359 --------------------
 drivers/target/tcm_fc/tfc_sess.c | 503 ---------------------------
 9 files changed, 2098 deletions(-)
 delete mode 100644 drivers/target/tcm_fc/Kconfig
 delete mode 100644 drivers/target/tcm_fc/Makefile
 delete mode 100644 drivers/target/tcm_fc/tcm_fc.h
 delete mode 100644 drivers/target/tcm_fc/tfc_cmd.c
 delete mode 100644 drivers/target/tcm_fc/tfc_conf.c
 delete mode 100644 drivers/target/tcm_fc/tfc_io.c
 delete mode 100644 drivers/target/tcm_fc/tfc_sess.c
drivers/target/Kconfig +0 -1
index c163b14774d7..4382e56527c0 100644
@@ -44,7 +44,6 @@ config TCM_USER2
 	is obsolete.
 
 source "drivers/target/loopback/Kconfig"
-source "drivers/target/tcm_fc/Kconfig"
 source "drivers/target/iscsi/Kconfig"
 source "drivers/target/sbp/Kconfig"
 
drivers/target/Makefile +0 -1
index 45634747377e..fd6729cfb0ff 100644
@@ -27,6 +27,5 @@ obj-$(CONFIG_TCM_USER2)		+= target_core_user.o
 
 # Fabric modules
 obj-$(CONFIG_LOOPBACK_TARGET)	+= loopback/
-obj-$(CONFIG_TCM_FC)		+= tcm_fc/
 obj-$(CONFIG_ISCSI_TARGET)	+= iscsi/
 obj-$(CONFIG_SBP_TARGET)	+= sbp/
drivers/target/tcm_fc/Kconfig deleted +0 -6
deleted file mode 100644
index 4f3b926b6a1a..000000000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-config TCM_FC
-	tristate "TCM_FC fabric Plugin"
-	depends on LIBFC
-	help
-	Say Y here to enable the TCM FC plugin for accessing FC fabrics in TCM
drivers/target/tcm_fc/Makefile deleted +0 -7
deleted file mode 100644
index a7d1593ab5af..000000000000
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-tcm_fc-y +=		tfc_cmd.o \
-			tfc_conf.o \
-			tfc_io.o \
-			tfc_sess.o
-
-obj-$(CONFIG_TCM_FC)	+= tcm_fc.o
drivers/target/tcm_fc/tcm_fc.h deleted +0 -169

169 lines not on this page · raw message

drivers/target/tcm_fc/tfc_cmd.c deleted +0 -561

561 lines not on this page · raw message

drivers/target/tcm_fc/tfc_conf.c deleted +0 -491

491 lines not on this page · raw message

drivers/target/tcm_fc/tfc_io.c deleted +0 -359

359 lines not on this page · raw message

drivers/target/tcm_fc/tfc_sess.c deleted +0 -503

503 lines not on this page · raw message

#1 lore raw
Quoted 30 lines · Bart Van Assche

Since its introduction in 2011, the tcm_fc driver processes SCSI read commands as follows if the number of remaining bytes is a multiple of four:
- Queue data by calling fc_seq_send(). The FCoE driver translates that call into a dev_queue_xmit(skb) call which sends the data asynchronously.
- After having queued the data for sending, free the data buffer synchronously from inside ft_queue_status().

This race condition can be triggered by running fio --verify against the FCoE initiator driver. Since this bug causes data corruption and since nobody has reported this bug since the tcm_fc driver went upstream, this is a strong indication that the tcm_fc driver is not being used. Hence remove this driver from the kernel tree.

Cc Kiran Patil <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Mike Christie <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Yi Zou <[email protected]>
---
  drivers/target/Kconfig           |   1 -
  drivers/target/Makefile          |   1 -
  drivers/target/tcm_fc/Kconfig    |   6 -
  drivers/target/tcm_fc/Makefile   |   7 -
  drivers/target/tcm_fc/tcm_fc.h   | 169 ----------
  drivers/target/tcm_fc/tfc_cmd.c  | 561 -------------------------------
  drivers/target/tcm_fc/tfc_conf.c | 491 ---------------------------
  drivers/target/tcm_fc/tfc_io.c   | 359 --------------------
  drivers/target/tcm_fc/tfc_sess.c | 503 ---------------------------
  9 files changed, 2098 deletions(-)
Quoted 8 lines

delete mode 100644 drivers/target/tcm_fc/Kconfig delete mode 100644 drivers/target/tcm_fc/Makefile delete mode 100644 drivers/target/tcm_fc/tcm_fc.h delete mode 100644 drivers/target/tcm_fc/tfc_cmd.c delete mode 100644 drivers/target/tcm_fc/tfc_conf.c delete mode 100644 drivers/target/tcm_fc/tfc_io.c delete mode 100644 drivers/target/tcm_fc/tfc_sess.c

Please, no. I'd rather keep it; having the tcm_fc driver in allows one to have a simple virtualized FCoE testbed. We're using it quite heavily for QA and validation.

I'd be happy to fix the race condition instead.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                Kernel Storage Architect
[email protected]                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer