srp_reconnect_rport(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ srp_reconnect_rport(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's srp_reconnect_rport, and it's literally about reconnecting to an SRP target port 🫢


πŸ’… NAME

srp_reconnect_rport β€” reconnect to an SRP target port 🌸


🌈 SYNOPSIS

int srp_reconnect_rport (struct srp_rport *rport );

πŸŽ€ ARGUMENTS

  • rport β€” the SRP target port. that's her, that's the girl πŸ’–

πŸ¦‹ DESCRIPTION

so here's the vibe: this function blocks SCSI command queueing before it invokes reconnect, so that queuecommand won't get invoked concurrently with reconnect from outside the SCSI EH. no cap, this matters β€” because a reconnect implementation may reallocate resources that queuecommand needs πŸ”₯

like, imagine queuecommand rolling up mid-reconnect asking for resources that just got yeeted. not the moment. so we block first. iconic behavior honestly πŸ‘‘


⭐ NOTES

  • 🚨 this function neither waits until outstanding requests have finished nor tries to abort these. that part is not on her. it's the responsibility of the reconnect function to finish outstanding commands before reconnecting to the target port. periodt πŸ’€
  • 🫢 it is the responsibility of the caller to ensure that the resources reallocated by the reconnect function won't be used while this function is in progress. two possible strategies, your pick bestie:
    • invoke this function from the context of the SCSI EH thread only ✨
    • or lock the rport mutex inside each SCSI LLD callback that can be invoked by the SCSI EH β€” that's the scsi_host_template.eh_*() functions and also the scsi_host_template.queuecommand function πŸ”’
lowkey important: those two notes are the whole safety situation. skip them and it's giving undefined chaos πŸ™ˆ

🌸 SEE ALSO

Kernel file ./drivers/scsi/scsi_transport_srp.c β€” and all her friends: srp_tmo_valid(9), srp_reconnect_work(9), rport_fast_io_fail_timedout(9), rport_dev_loss_timedout(9), srp_start_tl_fail_timers(9), srp_timed_out(9), srp_rport_get(9), srp_rport_put(9), srp_rport_add(9), srp_rport_del(9), srp_remove_host(9), srp_stop_rport_timers(9), srp_attach_transport(9), srp_release_transport(9) πŸ’œ


that's the whole page bestie, we ate πŸ“ from ./drivers/scsi, dated October 2026 β€” mwah, go reconnect something πŸ’…βœ¨

πŸ“¦ where this page comes from