From patchwork Fri Jan 4 23:14:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10748923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4679313BF for ; Fri, 4 Jan 2019 23:14:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3780728520 for ; Fri, 4 Jan 2019 23:14:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BBAF287FD; Fri, 4 Jan 2019 23:14:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCF9828520 for ; Fri, 4 Jan 2019 23:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726154AbfADXO4 (ORCPT ); Fri, 4 Jan 2019 18:14:56 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:40646 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbfADXO4 (ORCPT ); Fri, 4 Jan 2019 18:14:56 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x04NEXJE112877; Fri, 4 Jan 2019 23:14:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=XE7PmbAOFHFmeDPPgWwYSJAlWarcADv/9dXsRVP/gtI=; b=w3YcL/E6sHUbI077+DhV2TC586cJcaZkpwozFSuEYNxoEVr5SqWFlN14askn1ZqA8emw uwu6EXab9QKNzh1QnxLwkVLj74WKFjhsMy2LOGDzD5bJmfZJnaowD5xmYv8HDbvNDMmr qLrqZrwhV9qG/OEuej3HGJCNi45hYjJiPJEyQgtR4cYGy0MhniiAC36PwVY7futJrGcf +7mhYyxrdW919DH9PD3U2harrvlhsvFrtXPge4Ly+UY8MTHHhrw48j1FIumWNdzQUeZG OkcumxUSpZHG4VrHIPZxRG7B9tGPOtjLxkpAUDlrtXLLohBLAky+LyGUy86Mot5IHZNG eA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2pp1jrecj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Jan 2019 23:14:52 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x04NEpmt013138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Jan 2019 23:14:51 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x04NEoeT003645; Fri, 4 Jan 2019 23:14:51 GMT Received: from localhost (/10.145.178.58) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 04 Jan 2019 15:14:50 -0800 Date: Fri, 4 Jan 2019 15:14:48 -0800 From: "Darrick J. Wong" To: Eryu Guan Cc: xfs , fstests , Eric Sandeen Subject: [PATCH v2] generic: test that xattrs can have slashes in their names Message-ID: <20190104231448.GF12689@magnolia> References: <20190104212336.GC12689@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190104212336.GC12689@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9126 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901040194 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Eric Sandeen recently found a bug in xfs_repair that flagged extended attribute names containing "/" as corrupt and purged them. There's nothing in the IRIX or Linux manuals that say anything about slashes not being allowed (and Linux certainly allows this) so let's make sure this continues to work. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Carlos Maiolino --- tests/generic/708 | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/708.out | 6 ++++++ tests/generic/group | 1 + 3 files changed, 57 insertions(+) create mode 100755 tests/generic/708 create mode 100644 tests/generic/708.out diff --git a/tests/generic/708 b/tests/generic/708 new file mode 100755 index 00000000..c32f966c --- /dev/null +++ b/tests/generic/708 @@ -0,0 +1,50 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 708 +# +# Check that xattrs can have slashes in their name. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/attr +. ./common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch +_require_attrs + +rm -f $seqres.full + +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount + +echo "set attr" +file=$SCRATCH_MNT/moofile +touch $file +setfattr -n "user.boo/hoo" -v "woof" $file + +echo "check attr" +getfattr -d --absolute-names $file | _filter_scratch + +# Now we let the fsck tool check the filesystem, because xfs_repair had a +# regression where it would flag and erase any xattr with a '/' in it. + +status=0 +exit diff --git a/tests/generic/708.out b/tests/generic/708.out new file mode 100644 index 00000000..6978532e --- /dev/null +++ b/tests/generic/708.out @@ -0,0 +1,6 @@ +QA output created by 708 +set attr +check attr +# file: SCRATCH_MNT/moofile +user.boo/hoo="woof" + diff --git a/tests/generic/group b/tests/generic/group index ea5aa7aa..f88125b4 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -525,3 +525,4 @@ 520 auto quick log 521 soak long_rw 522 soak long_rw +708 auto quick attr