Skip to content

Commit 17b7a0c

Browse files
committed
nvmft: Don't offline a port being removed if it is already offline
This is generally harmless but can trigger spurious warnings on the console due to duplicate attempts to disable LUNs. Sponsored by: Chelsio Communications
1 parent 4015ff4 commit 17b7a0c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sys/dev/nvmf/controller/ctl_frontend_nvmf.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,13 @@ nvmft_port_remove(struct ctl_req *req)
915915
TAILQ_REMOVE(&nvmft_ports, np, link);
916916
sx_xunlock(&nvmft_ports_lock);
917917

918-
ctl_port_offline(&np->port);
918+
sx_slock(&np->lock);
919+
if (np->online) {
920+
sx_sunlock(&np->lock);
921+
ctl_port_offline(&np->port);
922+
} else
923+
sx_sunlock(&np->lock);
924+
919925
nvmft_port_rele(np);
920926
req->status = CTL_LUN_OK;
921927
}

0 commit comments

Comments
 (0)