Bug 1024702

Summary: [xfs/xfstests xfs/300] XFS_IOC_SWAPEXT failed: SCRATCH_MNT/300.test: Invalid argument
Product: Red Hat Enterprise Linux 6 Reporter: Eryu Guan <eguan>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: dhe
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: branto, eguan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: xfsprogs-3.1.1-15.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:49:53 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 Eryu Guan 2013-10-30 09:40:46 UTC
Description of problem:
xfstests xfs/300 fails, and I remembered that it's a userspace bug, file one to track it.

    --- tests/xfs/300.out	2013-10-29 00:25:19.000000000 -0400
    +++ /var/lib/xfstests/results//xfs/300.out.bad	2013-10-29 03:58:22.355124316 -0400
    @@ -1,3 +1,3 @@
     QA output created by 300
     SCRATCH_MNT/300.test
    -extents before:6 after:1 DONE SCRATCH_MNT/300.test
    +XFS_IOC_SWAPEXT failed: SCRATCH_MNT/300.test: Invalid argument

Version-Release number of selected component (if applicable):
xfsprogs-3.1.1-14.el6

How reproducible:
always

Steps to Reproduce:
1. check xfs/300 on xfs
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Eric Sandeen 2013-10-30 16:10:16 UTC
The perils of writing new tests, I guess.  ;)  Yes, I've sent a patch upstream for this but it's not reviewed yet.

Thanks,
-Eric

Comment 3 RHEL Program Management 2013-11-03 08:04:53 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 Eric Sandeen 2014-05-05 17:09:32 UTC
commit 1adfe5c6296d3ea6c182f31a6728fc94af9146f7
Author: Eric Sandeen <sandeen>
Date:   Fri Oct 18 22:30:18 2013 +0000

    xfs_fsr: fix SWAPEXT failures under selinux
    
    If we run xfs_fsr on a system which creates selinux extended
    attributes, the temp file created by xfs_fsr may have a
    large-ish local extended attribute as soon as it is created.
    
    If the target file has NON-local extended attributes, it may
    have a fork offset larger than the temp file, because i.e.
    FMT_EXTENTS attributes take up less space.  We currently
    have no mechanism to grow the temp file's fork offset.
    So in this case, the SWAPEXT ioctl will fail.
    
    (With systems using selinux and lots of xattrs, this becomes
    fairly common in the real world.)
    
    After testing the target file for a non-local extent, and
    checking to see if the temp forkoff needs to be grown on the
    first pass, we can add a large attr to knock all attributes on
    the temp file out of local format, and grow the fork offset for
    this particular case.
    
    This passes xfstest 227, and also resolves issues seen on
    a metadata image provided by Gabriel.

Comment 6 dhe 2014-08-15 03:27:00 UTC
Reproduced on xfsprogs-3.1.1-14.el6.x86_64
https://beaker.engineering.redhat.com/jobs/722160
In test_log-xfs:xfs-300 log:
Running test xfs/300
#! /bin/bash
# FS QA Test No. 300
#
# Test xfs_fsr / swapext management of di_forkoff w/ selinux
#
#-----------------------------------------------------------------------
# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
FSTYP         -- xfs (non-debug)
PLATFORM      -- Linux/x86_64 intel-sugarbay-do-01 2.6.32-431.el6.x86_64
MKFS_OPTIONS  -- -f -bsize=4096 /dev/loop1
MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/loop1 /mnt/testarea/scratch
xfs/300         - output mismatch (see /var/lib/xfstests/results//xfs/300.out.bad)
    --- tests/xfs/300.out        2014-08-14 22:44:07.000000000 -0400
    +++ /var/lib/xfstests/results//xfs/300.out.bad        2014-08-14 22:48:13.550913744 -0400
    @@ -1,3 +1,3 @@
     QA output created by 300
     SCRATCH_MNT/300.test
    -extents before:7 after:1 DONE SCRATCH_MNT/300.test
    +XFS_IOC_SWAPEXT failed: SCRATCH_MNT/300.test: Invalid argument
    ...
    (Run 'diff -u tests/xfs/300.out /var/lib/xfstests/results//xfs/300.out.bad'  to see the entire diff)
Ran: xfs/300
Failures: xfs/300
Failed 1 of 1 tests




Verified on xfsprogs-3.1.1-16.el6.x86_64
https://beaker.engineering.redhat.com/jobs/722185
In test_log-xfs:xfs-300 log:
Running test xfs/300
#! /bin/bash
# FS QA Test No. 300
#
# Test xfs_fsr / swapext management of di_forkoff w/ selinux
#
#-----------------------------------------------------------------------
# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
FSTYP         -- xfs (non-debug)
PLATFORM      -- Linux/x86_64 hp-dl388g8-15 2.6.32-496.el6.x86_64
MKFS_OPTIONS  -- -f -bsize=4096 /dev/loop1
MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/loop1 /mnt/testarea/scratch
xfs/300         0s
Ran: xfs/300
Passed all 1 tests

Comment 7 errata-xmlrpc 2014-10-14 07:49:53 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.

http://rhn.redhat.com/errata/RHBA-2014-1564.html