]> git.itanic.dy.fi Git - linux-stable/commit
SCSI: libsas: fix sas_discover_devices return code handling
authorDan Williams <dan.j.williams@intel.com>
Fri, 22 Jun 2012 06:36:20 +0000 (23:36 -0700)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:38:02 +0000 (23:38 +0200)
commite69e5d3d25d6b58543f782a515baeda064e2b601
tree252427c90259a68f6120713ab86a66fb87ed5f80
parent4b6a4ff5b8ef014109479e217fe1bd56b0a2b425
SCSI: libsas: fix sas_discover_devices return code handling

commit b17caa174a7e1fd2e17b26e210d4ee91c4c28b37 upstream.

commit 198439e4 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev()
commit 19252de6 [SCSI] libsas: fix wide port hotplug issues

The above commits seem to have confused the return value of
sas_ex_discover_dev which is non-zero on failure and
sas_ex_join_wide_port which just indicates short circuiting discovery on
already established ports.  The result is random discovery failures
depending on configuration.

Calls to sas_ex_join_wide_port are the source of the trouble as its
return value is errantly assigned to 'res'.  Convert it to bool and stop
returning its result up the stack.

Tested-by: Dan Melnic <dan.melnic@amd.com>
Reported-by: Dan Melnic <dan.melnic@amd.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/scsi/libsas/sas_expander.c