Skip to content

Commit

Permalink
scsi: core: Fix a procfs host directory removal regression
Browse files Browse the repository at this point in the history
scsi_proc_hostdir_rm() decreases a reference counter and hence must only be
called once per host that is removed. This change does not require a
scsi_add_host_with_dma() change since scsi_add_host_with_dma() will return
0 (success) if scsi_proc_host_add() is called.

Fixes: fc66371 ("scsi: core: Remove the /proc/scsi/${proc_name} directory earlier")
Cc: John Garry <[email protected]>
Reported-by: John Garry <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Reported-by: [email protected]
Link: https://lore.kernel.org/linux-scsi/[email protected]/
Signed-off-by: Bart Van Assche <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: John Garry <[email protected]>
Tested-by: Shin'ichiro Kawasaki <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
bvanassche authored and martinkpetersen committed Mar 10, 2023
1 parent 4b1a2c2 commit be03df3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ static void scsi_host_dev_release(struct device *dev)
struct Scsi_Host *shost = dev_to_shost(dev);
struct device *parent = dev->parent;

/* In case scsi_remove_host() has not been called. */
scsi_proc_hostdir_rm(shost->hostt);

/* Wait for functions invoked through call_rcu(&scmd->rcu, ...) */
rcu_barrier();

Expand Down

0 comments on commit be03df3

Please sign in to comment.