]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: core: sysfs: Fix setting device state to SDEV_RUNNING
authorMike Christie <michael.christie@oracle.com>
Sat, 20 Nov 2021 16:49:17 +0000 (10:49 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:04:50 +0000 (09:04 +0100)
commit4d87f39c2de6dd0899e8d184cfb925589e7283c2
tree09181346012da67fc8585fea37e103ec38b6441e
parent6924e8d76dc174f8da1e5380e00aee57ebf77398
scsi: core: sysfs: Fix setting device state to SDEV_RUNNING

[ Upstream commit 5939ec4b3e25376997b243808ecc7390ef4e4548 ]

This fixes an issue added in commit fa5a9c54cdce ("scsi: core: sysfs: Fix
hang when device state is set via sysfs") where if userspace is requesting
to set the device state to SDEV_RUNNING when the state is already
SDEV_RUNNING, we return -EINVAL instead of count. The commmit above set ret
to count for this case, when it should have set it to 0.

Link: https://lore.kernel.org/r/20211120164917.4924-1-michael.christie@oracle.com
Fixes: fa5a9c54cdce ("scsi: core: sysfs: Fix hang when device state is set via sysfs")
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_sysfs.c