bug#51407: parted didn’t check the returned sense data
Johnson.Yan--- via Bug reports for the GNU Parted disk partition editor <[email protected]> Tue, 26 Oct 2021 09:55:02 +0000
| Newsgroups | gmane.comp.gnu.parted.bugs |
|---|---|
| Message-ID | <PH0PR11MB4903E05BD9EC059E7BA220C4F4849@PH0PR11MB4903.namprd11.prod.outlook.com> |
Hi, When we did secure erase for large capacity drive (18TB), the drive capacity will changed to 0. This issue can be reproduced each time, please refer to attached files for details. From the system log we found parted send Read(16) to sde at Oct 13 01:30:02, due to security erase in progress “Not Ready” is returned from this drive which is expected. Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 Oct 13 01:30:02 localhost kernel: blk_update_request: I/O error, dev sde, sector 0 Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read Oct 13 01:30:02 localhost kernel: Buffer I/O error on dev sde, logical block 0, async page read // host tried to recover this drive by spinning up but no responding, which due to the same reason, i.e. security erase in progress. Oct 13 01:30:02 localhost kernel: sd 13:0:3:0: [sde] Spinning up disk... Oct 13 01:31:43 localhost kernel: ....................................................................................................not responding... // host send Read Capacity(16) and Read Capacity(10) but still failed (security erase in progress), finally host changed the capacity to zero. Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Read Capacity(16) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Sense Key : Not Ready [current] [descriptor] Oct 13 01:31:43 localhost kernel: sd 13:0:3:0: [sde] Add. Sense: Logical unit not ready, security session in progress Oct 13 01:31:43 localhost kernel: sde: detected capacity change from 18000207937536 to 0 I suppose parted should check the returned sense data and not change drive capacity to 0, could you please help to check this issue? Many thanks. Regards, Johnson
sde_test.log
(application/octet-stream, 8.4 KB)
[root@localhost SE_test]# hdparm -I /dev/sde
/dev/sde:
ATA device, with non-removable media
Model Number: ST18000NM000J-2TV103
Serial Number: ZR508D4G
Firmware Revision: SCA2
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Used: unknown (minor revision code 0xffff)
Supported: 11 10 9 8 7 6 5
Likely used: 11
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors:35156656128
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 17166336 MBytes
device size with M = 1000*1000: 18000207 MBytes (18000 GB)
cache/buffer size = unknown
Form Factor: 3.5 inch
Nominal Media Rotation Rate: 7200
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Recommended acoustic management value: 254, current value: 0
DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* WRITE_BUFFER command
* READ_BUFFER command
* DOWNLOAD_MICROCODE
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
* 48-bit Address feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* Media Card Pass-Through
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
Write-Read-Verify feature set
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* unknown 119[6]
* unknown 119[7]
unknown 119[8]
unknown 119[9]
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Phy event counters
* Idle-Unload when NCQ is active
* unknown 76[15]
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
unknown 78[7]
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
unknown 206[7]
unknown 206[12] (vendor specific)
unknown 206[13] (vendor specific)
unknown 206[14] (vendor specific)
* reserved 69[2]
* reserved 69[3]
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
Logical Unit WWN Device Identifier: 5000c500c7b668b7
NAA : 5
IEEE OUI : 000c50
Unique ID : 0c7b668b7
Checksum: correct
[root@localhost SE_test]# dd if=/dev/urandom of=/dev/sde bs=512 count=1000
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.0236397 s, 21.7 MB/s
[root@localhost SE_test]# dd if=/dev/sde of=/root/test1 bs=512 count=1000
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.00695484 s, 73.6 MB/s
[root@localhost SE_test]# fdisk -l |grep sde
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sde: 18000.2 GB, 18000207937536 bytes, 35156656128 sectors
[root@localhost SE_test]# dd if=/dev/urandom of=/dev/sde bs=1024k seek=17165336 count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 13.8843 s, 75.5 MB/s
[root@localhost SE_test]# dd if=/dev/sde of=/root/test2 bs=1024k skip=17165336 count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 8.47076 s, 124 MB/s
[root@localhost SE_test]# hdparm --user-master u --security-set-pass password /dev/sde
security_password="password"
/dev/sde:
Issuing SECURITY_SET_PASS command, password="password", user=user, mode=high
[root@localhost SE_test]# time hdparm --user-master u --security-erase password /dev/sde
security_password="password"
/dev/sde:
Issuing SECURITY_ERASE command, password="password", user=user
real 1422m34.793s
user 0m0.000s
sys 0m0.071s
You have new mail in /var/mail/root
[root@localhost SE_test]#
[root@localhost SE_test]#
[root@localhost SE_test]# dd if=/dev/sde of=/root/test3 bs=512 count=1000
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000283786 s, 0.0 kB/s
[root@localhost SE_test]# dd if=/dev/sde of=/root/test4 bs=1024k skip=17165336 count=1000
dd: ‘/dev/sde’: cannot skip: Invalid argument
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000368066 s, 0.0 kB/s
[root@localhost SE_test]# hdparm -I /dev/sde
/dev/sde:
ATA device, with non-removable media
Model Number: ST18000NM000J-2TV103
Serial Number: ZR508D4G
Firmware Revision: SCA2
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Used: unknown (minor revision code 0xffff)
Supported: 11 10 9 8 7 6 5
Likely used: 11
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors:35156656128
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 17166336 MBytes
device size with M = 1000*1000: 18000207 MBytes (18000 GB)
cache/buffer size = unknown
Form Factor: 3.5 inch
Nominal Media Rotation Rate: 7200
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Recommended acoustic management value: 254, current value: 0
DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* WRITE_BUFFER command
* READ_BUFFER command
* DOWNLOAD_MICROCODE
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
* 48-bit Address feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* Media Card Pass-Through
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
Write-Read-Verify feature set
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* unknown 119[6]
* unknown 119[7]
unknown 119[8]
unknown 119[9]
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Phy event counters
* Idle-Unload when NCQ is active
* unknown 76[15]
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
unknown 78[7]
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
unknown 206[7]
unknown 206[12] (vendor specific)
unknown 206[13] (vendor specific)
unknown 206[14] (vendor specific)
* reserved 69[2]
* reserved 69[3]
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
Logical Unit WWN Device Identifier: 5000c500c7b668b7
NAA : 5
IEEE OUI : 000c50
Unique ID : 0c7b668b7
Checksum: correct
messages.log
(application/octet-stream, 364.9 KB) - not displayed