]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: cxlflash: Fix vlun resize failure in the shrink path
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>
Fri, 25 Aug 2017 22:18:12 +0000 (17:18 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 22:24:04 +0000 (18:24 -0400)
commit6024b3beb8ce8fd15ad23a7b15bf1ee4f5fe1d68
tree5e6b730c1f96ae3d12ce46b17b2bfeddfc4b099c
parentd265ae559b60774f5390c9d0765c6db8aa22419f
scsi: cxlflash: Fix vlun resize failure in the shrink path

The ioctl DK_CAPI_VLUN_RESIZE can fail if the allocated vlun size is
reduced from almost maximum capacity and then increased again.

The shrink_lxt() routine is currently using the SISL_ASTATUS_MASK to
mask the higher 48 bits of the lxt entry. This is unnecessary and
incorrect as it uses a mask designed for the asynchronous interrupt
status register.  When the 4 port support was added to cxlflash, the
SISL_ASTATUS_MASK was updated to reflect the status bits for all 4
ports. This change indirectly affected the shrink_lxt() code path.

To extract the base, simply shift the bits without masking.

Fixes: 9f0cc0f4efc3 ("scsi: cxlflash: SISlite updates to support 4 ports")
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/vlun.c