Hide Forgot
Description of problem: RHEL4.9 HVM guest can write to a read-only SCSI disk although the read-only "r" flag is set in guest configure. And tons of the error message show up after the file operation, as following: SCSI error : <0 0 0 0> return code = 0x8000002 Info fld=0x0, Current sda: sense key Hardware Error end_request: I/O error, dev sda, sector 63 Buffer I/O error on device sda1, logical block 0 lost page write due to I/O error on sda1 Version-Release number of selected component (if applicable): host: kernel-xen-2.6.18-302.el5, xen-3.0.3-135.el5 guest: RHEL4U9 RC, kernel-2.6.9-100.EL How reproducible: 100% Steps to Reproduce: 1. Start a RHEL4U9 HVM guest with follow disk parameter: disk = ["file:/data/exp/images/RHEL-4.9-32-hvm.raw,hda,w","file:/data/exp/images/raw.img,sdb,r"] make sure the raw.img is partitioned before and has a file system inside. 2. Check the disk status by fdisk in guest, and mount the SCSI disk to a empty directory. 3. Create a new file in the read-only disk or try to remove a file from the read-only disk 4. Destroy the guest and recreate it again. Actual results: 1. At step 2, the first error message shows up: SCSI error : <0 0 0 0> return code = 0x8000002 Info fld=0x0, Current sda: sense key Hardware Error end_request: I/O error, dev sda, sector 63 Buffer I/O error on device sda1, logical block 0 lost page write due to I/O error on sda1 2. At step3, it seems the file operation succeed in guest and tons of error messages show up. 3. After step4, the read-only disk seems not touched. The created file in step 3 does not exist, and the deleted file in step 4 is still there. Expected results: 1. At step 2, a proper read-only warning message shows up rather than the error message. 2. At step 3, the file operation should fail with proper message. Additional info: 1. guest dmesg log attached. 2. The writeable SCSI disk works fine in RHEL4.9 guest. 3. The read-only SCSI disk works fine in RHEL5.8 guest. 4. if use following command to change the content of an unformatted read-only scsi disk, you will find the content of read-only SCSI disk is not changed. #dd if=/dev/hda of=/dev/sda bs=1M count=1 #od -x /dev/sda1 -N 512
Created attachment 549676 [details] guest dmesg log
This is problem of guest kernel that is not aware of scsi read-only state.
Changing component to "kernel". The guest kernel is a bare-metal kernel. The disk is an emulated (ie. not paravirt / PV-on-HVM) QEMU disk, so the guest-side driver is the "normal" scsi driver. The host side emulation (qemu-dm) works correctly, as per comment 0 / additional info / 3.
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. Please See https://access.redhat.com/support/policy/updates/errata/ If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.