lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yq14kn5wgqf.fsf@ca-mkp.ca.oracle.com>
Date:   Wed, 07 Oct 2020 23:47:28 -0400
From:   "Martin K. Petersen" <martin.petersen@...cle.com>
To:     Bean Huo <huobean@...il.com>
Cc:     jejb@...ux.ibm.com, martin.petersen@...cle.com, bvanassche@....org,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Bean Huo <beanhuo@...ron.com>
Subject: Re: [PATCH] scsi: sd: Use UNMAP in case the device doesn't support
 WRITE_SAME


Bean,

> There exists a storage device that supports READ_CAPACITY, but doesn't
> support WRITE_SAME. The problem is that WRITE SAME heuristics doesn't work
> for this kind of storage device since its block limits VPD page doesn't
> contain the LBP information. Currently we set its provisioning_mode
> "writesame_16" and didn't check "no_write_same".

There is something odd with what your device is reporting.

We support WRITE SAME on a bunch of devices that predate the Logical
Block Provisioning VPD page and the various Block Limits parameters
being introduced to the spec. Consequently we set the provisioning mode
to "writesame_16" if the device reports LBPME=1 in READ CAPACITY(16) and
nothing relevant is reported in the VPD pages. That is by design.

> If we didn't manually change this default provisioning_mode to "unmap"
> through sysfs, provisioning_mode will be set to "disabled" after the
> first WRITE_SAME command with the following error occurs:

If your device supports UNMAP it *must* report it in the Logical Block
Provisioning VPD by setting LBPU=1 and report MAXIMUM UNMAP LBA COUNT
and MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT in the Block Limits VPD.

Also, "no_write_same" disables attempting to use WRITE SAME to zero
block ranges. That's orthogonal to the logic controlling which command
to use for performing an unmap operation. An unfortunate choice of
naming which can be attributed to the SCSI protocol using the WRITE SAME
command for two completely different operations.

-- 
Martin K. Petersen	Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ