@@ -773,10 +773,11 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
773773 unsigned long flags ;
774774 int idx ;
775775 int with_qtcb = (req -> qtcb != NULL );
776+ int req_id = req -> req_id ;
776777
777778 /* put allocated FSF request into hash table */
778779 spin_lock_irqsave (& adapter -> req_list_lock , flags );
779- idx = zfcp_reqlist_hash (req -> req_id );
780+ idx = zfcp_reqlist_hash (req_id );
780781 list_add_tail (& req -> list , & adapter -> req_list [idx ]);
781782 spin_unlock_irqrestore (& adapter -> req_list_lock , flags );
782783
@@ -786,7 +787,8 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
786787 del_timer (& req -> timer );
787788 spin_lock_irqsave (& adapter -> req_list_lock , flags );
788789 /* lookup request again, list might have changed */
789- if (zfcp_reqlist_find_safe (adapter , req ))
790+ req = zfcp_reqlist_find (adapter , req_id );
791+ if (req )
790792 zfcp_reqlist_remove (adapter , req );
791793 spin_unlock_irqrestore (& adapter -> req_list_lock , flags );
792794 zfcp_erp_adapter_reopen (adapter , 0 , "fsrs__1" , req );
@@ -1262,13 +1264,13 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
12621264 FSF_FEATURE_UPDATE_ALERT ;
12631265 req -> erp_action = erp_action ;
12641266 req -> handler = zfcp_fsf_exchange_config_data_handler ;
1265- erp_action -> fsf_req = req ;
1267+ erp_action -> fsf_req_id = req -> req_id ;
12661268
12671269 zfcp_fsf_start_erp_timer (req );
12681270 retval = zfcp_fsf_req_send (req );
12691271 if (retval ) {
12701272 zfcp_fsf_req_free (req );
1271- erp_action -> fsf_req = NULL ;
1273+ erp_action -> fsf_req_id = 0 ;
12721274 }
12731275out :
12741276 spin_unlock_bh (& qdio -> req_q_lock );
@@ -1355,13 +1357,13 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
13551357
13561358 req -> handler = zfcp_fsf_exchange_port_data_handler ;
13571359 req -> erp_action = erp_action ;
1358- erp_action -> fsf_req = req ;
1360+ erp_action -> fsf_req_id = req -> req_id ;
13591361
13601362 zfcp_fsf_start_erp_timer (req );
13611363 retval = zfcp_fsf_req_send (req );
13621364 if (retval ) {
13631365 zfcp_fsf_req_free (req );
1364- erp_action -> fsf_req = NULL ;
1366+ erp_action -> fsf_req_id = 0 ;
13651367 }
13661368out :
13671369 spin_unlock_bh (& qdio -> req_q_lock );
@@ -1521,14 +1523,14 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
15211523 hton24 (req -> qtcb -> bottom .support .d_id , port -> d_id );
15221524 req -> data = port ;
15231525 req -> erp_action = erp_action ;
1524- erp_action -> fsf_req = req ;
1526+ erp_action -> fsf_req_id = req -> req_id ;
15251527 get_device (& port -> sysfs_device );
15261528
15271529 zfcp_fsf_start_erp_timer (req );
15281530 retval = zfcp_fsf_req_send (req );
15291531 if (retval ) {
15301532 zfcp_fsf_req_free (req );
1531- erp_action -> fsf_req = NULL ;
1533+ erp_action -> fsf_req_id = 0 ;
15321534 put_device (& port -> sysfs_device );
15331535 }
15341536out :
@@ -1591,13 +1593,13 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
15911593 req -> data = erp_action -> port ;
15921594 req -> erp_action = erp_action ;
15931595 req -> qtcb -> header .port_handle = erp_action -> port -> handle ;
1594- erp_action -> fsf_req = req ;
1596+ erp_action -> fsf_req_id = req -> req_id ;
15951597
15961598 zfcp_fsf_start_erp_timer (req );
15971599 retval = zfcp_fsf_req_send (req );
15981600 if (retval ) {
15991601 zfcp_fsf_req_free (req );
1600- erp_action -> fsf_req = NULL ;
1602+ erp_action -> fsf_req_id = 0 ;
16011603 }
16021604out :
16031605 spin_unlock_bh (& qdio -> req_q_lock );
@@ -1817,13 +1819,13 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
18171819 req -> qtcb -> header .port_handle = erp_action -> port -> handle ;
18181820 req -> erp_action = erp_action ;
18191821 req -> handler = zfcp_fsf_close_physical_port_handler ;
1820- erp_action -> fsf_req = req ;
1822+ erp_action -> fsf_req_id = req -> req_id ;
18211823
18221824 zfcp_fsf_start_erp_timer (req );
18231825 retval = zfcp_fsf_req_send (req );
18241826 if (retval ) {
18251827 zfcp_fsf_req_free (req );
1826- erp_action -> fsf_req = NULL ;
1828+ erp_action -> fsf_req_id = 0 ;
18271829 }
18281830out :
18291831 spin_unlock_bh (& qdio -> req_q_lock );
@@ -1991,7 +1993,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
19911993 req -> handler = zfcp_fsf_open_unit_handler ;
19921994 req -> data = erp_action -> unit ;
19931995 req -> erp_action = erp_action ;
1994- erp_action -> fsf_req = req ;
1996+ erp_action -> fsf_req_id = req -> req_id ;
19951997
19961998 if (!(adapter -> connection_features & FSF_FEATURE_NPIV_MODE ))
19971999 req -> qtcb -> bottom .support .option = FSF_OPEN_LUN_SUPPRESS_BOXING ;
@@ -2000,7 +2002,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
20002002 retval = zfcp_fsf_req_send (req );
20012003 if (retval ) {
20022004 zfcp_fsf_req_free (req );
2003- erp_action -> fsf_req = NULL ;
2005+ erp_action -> fsf_req_id = 0 ;
20042006 }
20052007out :
20062008 spin_unlock_bh (& qdio -> req_q_lock );
@@ -2077,13 +2079,13 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
20772079 req -> handler = zfcp_fsf_close_unit_handler ;
20782080 req -> data = erp_action -> unit ;
20792081 req -> erp_action = erp_action ;
2080- erp_action -> fsf_req = req ;
2082+ erp_action -> fsf_req_id = req -> req_id ;
20812083
20822084 zfcp_fsf_start_erp_timer (req );
20832085 retval = zfcp_fsf_req_send (req );
20842086 if (retval ) {
20852087 zfcp_fsf_req_free (req );
2086- erp_action -> fsf_req = NULL ;
2088+ erp_action -> fsf_req_id = 0 ;
20872089 }
20882090out :
20892091 spin_unlock_bh (& qdio -> req_q_lock );
0 commit comments