Bug 1377931

Summary: XFS corruption when xfs_copy a V5 XFS to multiple targets
Product: Red Hat Enterprise Linux 7 Reporter: Zorro Lang <zlang>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Zorro Lang <zlang>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.3CC: bugproxy, chorn, dwysocha, eguan, esandeen, fj-lsoft-kernel-it, hannsj_uhl, swhiteho, yoguma
Target Milestone: rcKeywords: ZStream
Target Release: 7.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xfsprogs-4.5.0-10.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1450875 (view as bug list) Environment:
Last Closed: 2017-08-01 23:11:44 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:
Bug Depends On:    
Bug Blocks: 1298243, 1299988, 1317092, 1436652, 1440030, 1446211, 1450875    
Attachments:
Description Flags
Fix meta UUID handling on multiple copies.patch
none
xfsprogs rpm package
none
xfsprogs rpm package
none
dmesg of test
none
Test full log none

Description Zorro Lang 2016-09-21 04:42:44 UTC
Description of problem:
I'm trying to modify xfs/073, to make it cover V5 xfs copy test. Then I found fs corruption when xfs_copy a V5 XFS to multiple targets(xfs_copy $dev_with_v5_xfs $target1 $target2), then xfs_repair -n will find fs corruption. V4 XFS(crc=0) no this problem. 

Version-Release number of selected component (if applicable):
xfsprogs-4.5.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. mkfs.xfs -m crc=1 -d name=fsfile,file=1,size=512m
2. xfs_copy fsfile target1 target2
3. xfs_repair -n target1
4. xfs_repair -n target2

Actual results:
Step#3 and/or step$4 will find corruption

Expected results:
no corruption

Additional info:
Eric has sent a patch:
  "[PATCH] xfs_copy: Fix meta UUID handling on multiple copies"
to upstream to fix this problem.

Comment 2 Eric Sandeen 2016-09-21 13:19:44 UTC
Moving to 7.4, I don't see this as a blocker for rhel7.3 - xfs_copy isn't in wide use, when used, multiple targets are rare, the corruption is immediately discoverable, and it can be worked around by doing one copy at a time.

Comment 7 Eric Sandeen 2017-03-01 16:27:32 UTC
*** Bug 1406654 has been marked as a duplicate of this bug. ***

Comment 12 Zorro Lang 2017-03-28 13:13:02 UTC
Reproduced on xfsprogs-4.5.0-9.el7_3:

=== copying scratch device to multiple targets
Creating file <FSIMAGE1>
Creating file <FSIMAGE2>
 0%  ... 10%  ... 20%  ... 30%  ... 40%  ... 50%  ... 60%  ... 70%  ... 80%  ... 90%  ... 100%

All copies completed.
checking new image
mounting new image on loopback
comparing new image files to old
comparing new image directories to old
comparing new image geometry to old
unmounting and removing new image
checking new image
_check_xfs_filesystem: filesystem on /mnt/test/13055.image2 is inconsistent (c)
(see /root/git/xfstests-dev/results//xfs/073.full for details)
_check_xfs_filesystem: filesystem on /mnt/test/13055.image2 is inconsistent (r)


Test passed on xfsprogs-4.5.0-11.el7 with different block size:
xfs/073 16s ... 16s
Ran: xfs/073
Passed all 1 tests

Comment 13 Eric Sandeen 2017-03-28 21:28:06 UTC
*** Bug 1436652 has been marked as a duplicate of this bug. ***

Comment 14 IBM Bug Proxy 2017-03-29 08:31:25 UTC
Created attachment 1267248 [details]
Fix meta UUID handling on multiple copies.patch

Comment 15 IBM Bug Proxy 2017-03-29 08:31:31 UTC
Created attachment 1267249 [details]
xfsprogs rpm package

Comment 16 IBM Bug Proxy 2017-03-29 08:31:34 UTC
Created attachment 1267250 [details]
xfsprogs rpm package

Comment 17 IBM Bug Proxy 2017-03-29 08:31:38 UTC
Created attachment 1267251 [details]
dmesg of test

Comment 18 IBM Bug Proxy 2017-03-29 08:33:03 UTC
Created attachment 1267252 [details]
Test full log

Comment 20 IBM Bug Proxy 2017-05-09 12:41:37 UTC
------- Comment From hannsj_uhl.com 2017-05-09 08:28 EDT-------
Comment from  Harish Sriram 2017-05-09 07:05:38 CDT

The issue in this bugzilla is resolved.

# rpm -qa | grep xfs
xfsprogs-devel-4.5.0-11.el7.ppc64le
xfsdump-3.1.4-1.el7.ppc64le
xfsprogs-4.5.0-11.el7.ppc64le

# ./check tests/xfs/073
FSTYP         -- xfs (non-debug)
PLATFORM      -- Linux/ppc64le zzfp189p1 4.11.0-1.el7.ppc64le
MKFS_OPTIONS  -- -f -bsize=4096 /dev/loop1
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/loop1 /mnt/scratch

xfs/073	 28s

# uname -a
Linux linux 4.11.0-1.el7.ppc64le #1 SMP Wed May 3 18:32:58 EDT 2017 ppc64le ppc64le ppc64le GNU/Linux

Comment 21 Hanns-Joachim Uhl 2017-05-09 13:03:29 UTC
oops ... the previous comment has to read:
"
Comment from  Harish Sriram 2017-05-09 07:05:38 CDT

The issue in this bugzilla is resolved.

# rpm -qa | grep xfs
xfsprogs-devel-4.5.0-11.el7.ppc64le
xfsdump-3.1.4-1.el7.ppc64le
xfsprogs-4.5.0-11.el7.ppc64le

# ./check tests/xfs/073
FSTYP         -- xfs (non-debug)
PLATFORM      -- Linux/ppc64le zzfp189p1 4.11.0-1.el7.ppc64le
MKFS_OPTIONS  -- -f -bsize=4096 /dev/loop1
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/loop1 /mnt/scratch

xfs/073	 28s
Ran: xfs/073
Passed all 1 tests

# uname -a
Linux linux 4.11.0-1.el7.ppc64le #1 SMP Wed May 3 18:32:58 EDT 2017 ppc64le ppc64le ppc64le GNU/Linux
"
...

Comment 25 errata-xmlrpc 2017-08-01 23:11:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2206