Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1037978

Summary: In RHEL5.10 guest, the MD5 value of the file saved in libiscsi data disk is changed after cut off the host power.
Product: Red Hat Enterprise Linux 7 Reporter: huiqingding <huding>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, areis, hhuang, huding, juzhang, knoel, pbonzini, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-21 14:58:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description huiqingding 2013-12-04 08:04:15 UTC
Description of problem:
Boot a RHEL5.10 guest attched a libiscsi data disk, dd a file in this libiscsi data disk, check the MD value of this file, run "sync" and then cut off the host power immediately after fsync command return. Boot host and guest, found the MD value is changed.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-20.el7.x86_64
kernel-3.10.0-57.el7.x86_64

RHEL5.10 guest:
kernel-2.6.18-371.el5

How reproducible:
100%

Steps to Reproduce:
1. Boot a RHEL5.10 guest, attached a libiscsi data disk
# /usr/libexec/qemu-kvm -M q35 -cpu SandyBridge -enable-kvm -m 2048 -smp 2,sockets=1,cores=2,threads=1 -name rhel7 -uuid 6afa5f93-2d4f-420f-81c6-e5fdddbd1c83 -drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/1,if=none,id=drive-virtio-disk0,format=qcow2,serial=40c061dd-5d60-4fc5-865f-55db700407f0,werror=stop,rerror=stop,aio=threads,cache=none -device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0a:00 -vnc :1 -monitor stdio -spice port=5900,disable-ticketing  -qmp tcp:0:4445,server,nowait -drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/4,if=none,id=drive-virtio-disk1,format=qcow2,serial=40c061dd-5d60-4fc5-865f-55db700407f0,werror=stop,rerror=stop,aio=threads,cache=none -device virtio-blk-pci,scsi=off,drive=drive-virtio-disk1,id=virtio-disk1

2. In guest, create a primary partition and make ext3 filesystem
# fdisk /dev/vdb
# mkfs.ext3 /dev/vdb1

3. In guest, dd a file, check MD value and run "sync"
# dd if=/dev/urandom of=file1 bs=1M count=512 ; md5sum file1 ; sync

4. cut off the host power immediately after sync command return

5. Boot host and guest, check the MD5 value in guest

Actual results:
The MD5 value of step3 is: 01b1dd504106f9cd6fa0536fc4a67252
The MD5 value of step5 is: 8565f264753d432025ab0b96d8f1267a

Expected results:
The MD5 value of step3 and step5 should be same.

Additional info:

Comment 2 Paolo Bonzini 2013-12-17 16:36:53 UTC
sync may not be enough.  Try using virtio-scsi and "sync; sg_sync /dev/sdX".

Comment 3 juzhang 2013-12-18 02:26:17 UTC
(In reply to Paolo Bonzini from comment #2)
> sync may not be enough.  Try using virtio-scsi and "sync; sg_sync /dev/sdX".

Hi Huiding,

Could you please have a try and update the testing result in the bz?

Best Regards,
Junyi

Comment 4 huiqingding 2013-12-18 07:38:54 UTC
(In reply to Paolo Bonzini from comment #2)
> sync may not be enough.  Try using virtio-scsi and "sync; sg_sync /dev/sdX".

Hello, Paolo

I test RHEL7.0 guest using virtio-blk and virtio-scsi. Not hit this bug.

Since the kernel of RHEL5.10 has not the driver of virtio-scsi, I cannot test this bug using virtio-scsi.

Comment 5 Paolo Bonzini 2013-12-18 12:14:14 UTC
On virtio-blk you can replace sg_sync /dev/sdX with this C program:

#include <fcntl.h>
#include <unistd.h>

int main(int argc, char **argv)
{
  if (argc == 1) return 1;
  int fd = open(argv[1], O_RDWR);
  fsync(fd);
}

Comment 6 huiqingding 2013-12-19 03:07:52 UTC
(In reply to Paolo Bonzini from comment #5)
> On virtio-blk you can replace sg_sync /dev/sdX with this C program:
> 
> #include <fcntl.h>
> #include <unistd.h>
> 
> int main(int argc, char **argv)
> {
>   if (argc == 1) return 1;
>   int fd = open(argv[1], O_RDWR);
>   fsync(fd);
> }

Hello, Paolo

I use the above C program to sync my virtio-blk device. But the MD5 values are also different.

Comment 7 Paolo Bonzini 2014-02-21 14:58:01 UTC
I think this is a rhel5 kernel bug.