[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2019-07-24 Thread Brad Figg
** Tags added: cscc

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Fix Released
Status in linux source package in Bionic:
  Fix Released

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-08-31 Thread Frank Heimes
Since we are on 4.15.0.33.35 with bionic, I'm marking bionic as Fix
Released and close the ticket.

** Changed in: linux (Ubuntu Bionic)
   Status: Fix Committed => Fix Released

** Changed in: ubuntu-z-systems
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Fix Released
Status in linux source package in Bionic:
  Fix Released

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-08-14 Thread Joseph Salisbury
Confirmed this patch is in the Ubuntu-4.15.0-31 kernel as commit:

b4756bd452c1 scsi: zfcp: fix infinite iteration on ERP ready list

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Fix Released
Status in linux source package in Bionic:
  Fix Committed

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-08-03 Thread Dimitri John Ledkov
$ git tag --contains fa89adba1941e4f3b213399b81732a5c12fd9131 Ubuntu-4.17.0-6.7
Ubuntu-4.17.0-6.7


** Changed in: linux (Ubuntu)
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Fix Released
Status in linux source package in Bionic:
  Fix Committed

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-30 Thread Frank Heimes
** Changed in: ubuntu-z-systems
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Fix Committed
Status in linux source package in Bionic:
  Fix Committed

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-30 Thread Joseph Salisbury
This commit is now in the Bionic master-next repo.

** Changed in: linux (Ubuntu)
   Status: In Progress => Fix Committed

** Changed in: linux (Ubuntu Bionic)
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  Fix Committed
Status in linux source package in Bionic:
  Fix Committed

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-30 Thread Joseph Salisbury
The commit made it's way into bionic via the upstream stable updates
posted in bug 1783418

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  Fix Committed
Status in linux source package in Bionic:
  Fix Committed

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-05 Thread Joseph Salisbury
built a test kernel with commit
fa89adba1941e4f3b213399b81732a5c12fd9131.  The test kernel can be
downloaded from:

http://kernel.ubuntu.com/~jsalisbury/lp1780067

Can you test this kernel and see if it resolves this bug?

Note about installing test kernels:
• If the test kernel is prior to 4.15(Bionic) you need to install the 
linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the 
linux-modules, linux-modules-extra and linux-image-unsigned .deb packages.

Thanks in advance!

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: 

[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-05 Thread Frank Heimes
** Changed in: ubuntu-z-systems
   Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-05 Thread Joseph Salisbury
** Changed in: linux (Ubuntu)
   Importance: Undecided => High

** Changed in: linux (Ubuntu)
   Status: New => In Progress

** Also affects: linux (Ubuntu Bionic)
   Importance: Undecided
   Status: New

** Changed in: linux (Ubuntu Bionic)
   Importance: Undecided => High

** Changed in: linux (Ubuntu Bionic)
   Status: New => In Progress

** Changed in: linux (Ubuntu Bionic)
 Assignee: (unassigned) => Joseph Salisbury (jsalisbury)

** Changed in: linux (Ubuntu)
 Assignee: Skipper Bug Screeners (skipper-screen-team) => Joseph Salisbury 
(jsalisbury)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Triaged
Status in linux package in Ubuntu:
  In Progress
Status in linux source package in Bionic:
  In Progress

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: 

[Kernel-packages] [Bug 1780067] Re: zfcp: fix infinite iteration on ERP ready list

2018-07-04 Thread Frank Heimes
** Also affects: ubuntu-z-systems
   Importance: Undecided
   Status: New

** Changed in: ubuntu-z-systems
   Importance: Undecided => High

** Changed in: ubuntu-z-systems
   Status: New => Triaged

** Changed in: ubuntu-z-systems
 Assignee: (unassigned) => Canonical Kernel Team (canonical-kernel-team)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1780067

Title:
  zfcp: fix infinite iteration on ERP ready list

Status in Ubuntu on IBM z Systems:
  Triaged
Status in linux package in Ubuntu:
  New

Bug description:
  Please backport:
  commit fa89adba1941e4f3b213399b81732a5c12fd9131
  scsi: zfcp: fix infinite iteration on ERP ready list
  
  zfcp_erp_adapter_reopen() schedules blocking of all of the adapter's
  rports via zfcp_scsi_schedule_rports_block() and enqueues a reopen
  adapter ERP action via zfcp_erp_action_enqueue(). Both are separately
  processed asynchronously and concurrently.
  
  Blocking of rports is done in a kworker by zfcp_scsi_rport_work(). It
  calls zfcp_scsi_rport_block(), which then traces a DBF REC "scpdely" via
  zfcp_dbf_rec_trig().  zfcp_dbf_rec_trig() acquires the DBF REC spin lock
  and then iterates with list_for_each() over the adapter's ERP ready list
  without holding the ERP lock. This opens a race window in which the
  current list entry can be moved to another list, causing list_for_each()
  to iterate forever on the wrong list, as the erp_ready_head is never
  encountered as terminal condition.
  
  Meanwhile the ERP action can be processed in the ERP thread by
  zfcp_erp_thread(). It calls zfcp_erp_strategy(), which acquires the ERP
  lock and then calls zfcp_erp_action_to_running() to move the ERP action
  from the ready to the running list.  zfcp_erp_action_to_running() can
  move the ERP action using list_move() just during the aforementioned
  race window. It then traces a REC RUN "erator1" via zfcp_dbf_rec_run().
  zfcp_dbf_rec_run() tries to acquire the DBF REC spin lock. If this is
  held by the infinitely looping kworker, it effectively spins forever.
  
  Example Sequence Diagram:
  
  ProcessERP Thread rport_work
  ---------
  zfcp_erp_adapter_reopen()
  zfcp_erp_adapter_block()
  zfcp_scsi_schedule_rports_block()
  lock ERP  zfcp_scsi_rport_work()
  zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER)
  list_add_tail() on ready  !(rport_task==RPORT_ADD)
  wake_up() ERP thread  zfcp_scsi_rport_block()
  zfcp_dbf_rec_trig()zfcp_erp_strategy()zfcp_dbf_rec_trig()
  unlock ERPlock DBF REC
  zfcp_erp_wait()lock ERP
  |  zfcp_erp_action_to_running()
  | list_for_each() ready
  |  list_move()  current entry
  |ready to running
  |  zfcp_dbf_rec_run()   endless loop over running
  |  zfcp_dbf_rec_run_lvl()
  |  lock DBF REC spins forever
  
  Any adapter recovery can trigger this, such as setting the device offline
  or reboot.
  
  V4.9 commit 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport
  during rport gone") introduced additional tracing of (un)blocking of
  rports. It missed that the adapter->erp_lock must be held when calling
  zfcp_dbf_rec_trig().
  
  This fix uses the approach formerly introduced by commit aa0fec62391c
  ("[SCSI] zfcp: Fix sparse warning by providing new entry in dbf") that got
  later removed by commit ae0904f60fab ("[SCSI] zfcp: Redesign of the debug
  tracing for recovery actions.").
  
  Introduce zfcp_dbf_rec_trig_lock(), a wrapper for zfcp_dbf_rec_trig() that
  acquires and releases the adapter->erp_lock for read.
  
  Reported-by: Sebastian Ott 
  Signed-off-by: Jens Remus 
  Fixes: 4eeaa4f3f1d6 ("zfcp: close window with unblocked rport during 
rport gone")
  Cc:  # 2.6.32+
  Reviewed-by: Benjamin Block 
  Signed-off-by: Steffen Maier 
  Signed-off-by: Martin K. Petersen 

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1780067/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp