hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/scsi/scsi_transport_srp.c
....@@ -1,22 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * SCSI RDMA (SRP) transport class
34 *
45 * Copyright (C) 2007 FUJITA Tomonori <tomof@acm.org>
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation, version 2 of the
9
- * License.
10
- *
11
- * This program is distributed in the hope that it will be useful, but
12
- * WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19
- * 02110-1301 USA
206 */
217 #include <linux/init.h>
228 #include <linux/module.h>
....@@ -409,6 +395,10 @@
409395 }
410396 }
411397
398
+/*
399
+ * scsi_target_block() must have been called before this function is
400
+ * called to guarantee that no .queuecommand() calls are in progress.
401
+ */
412402 static void __rport_fail_io_fast(struct srp_rport *rport)
413403 {
414404 struct Scsi_Host *shost = rport_to_shost(rport);
....@@ -418,11 +408,7 @@
418408
419409 if (srp_rport_set_state(rport, SRP_RPORT_FAIL_FAST))
420410 return;
421
- /*
422
- * Call scsi_target_block() to wait for ongoing shost->queuecommand()
423
- * calls before invoking i->f->terminate_rport_io().
424
- */
425
- scsi_target_block(rport->dev.parent);
411
+
426412 scsi_target_unblock(rport->dev.parent, SDEV_TRANSPORT_OFFLINE);
427413
428414 /* Involve the LLD if possible to terminate all I/O on the rport. */
....@@ -591,8 +577,6 @@
591577 * failure timers if these had not yet been started.
592578 */
593579 __rport_fail_io_fast(rport);
594
- scsi_target_unblock(&shost->shost_gendev,
595
- SDEV_TRANSPORT_OFFLINE);
596580 __srp_start_tl_fail_timers(rport);
597581 } else if (rport->state != SRP_RPORT_BLOCKED) {
598582 scsi_target_unblock(&shost->shost_gendev,