ACK: [SRU][Zesty][PATCH 1/1] scsi: cxlflash: Fix vlun resize failure in the shrink path
Stefan Bader
stefan.bader at canonical.com
Wed Sep 27 18:42:32 UTC 2017
On 20.09.2017 11:47, Joseph Salisbury wrote:
> From: Uma Krishnan <ukrishn at linux.vnet.ibm.com>
>
> BugLink: http://bugs.launchpad.net/bugs/1713575
>
> 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: 565180723294 ("scsi: cxlflash: SISlite updates to support 4 ports")
> Signed-off-by: Uma Krishnan <ukrishn at linux.vnet.ibm.com>
> Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
> (cherry picked from commit 07a191f762a7b8d0db13c38036380927116e29bb)
> Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
> drivers/scsi/cxlflash/vlun.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c
> index 6c4cd3f..8de6a80 100644
> --- a/drivers/scsi/cxlflash/vlun.c
> +++ b/drivers/scsi/cxlflash/vlun.c
> @@ -694,11 +694,7 @@ static int shrink_lxt(struct afu *afu,
> /* Free LBAs allocated to freed chunks */
> mutex_lock(&blka->mutex);
> for (i = delta - 1; i >= 0; i--) {
> - /* Mask the higher 48 bits before shifting, even though
> - * it is a noop
> - */
> - aun = (lxt_old[my_new_size + i].rlba_base & SISL_ASTATUS_MASK);
> - aun = (aun >> MC_CHUNK_SHIFT);
> + aun = lxt_old[my_new_size + i].rlba_base >> MC_CHUNK_SHIFT;
> if (needs_ws)
> write_same16(sdev, aun, MC_CHUNK_SIZE);
> ba_free(&blka->ba_lun, aun);
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20170927/c7418f57/attachment.sig>
More information about the kernel-team
mailing list