From patchwork Tue Apr 9 04:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 10890517 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 3B94117E1 for ; Tue, 9 Apr 2019 04:54:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D9DF28800 for ; Tue, 9 Apr 2019 04:54:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1089D28834; Tue, 9 Apr 2019 04:54:13 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 AE2F228800 for ; Tue, 9 Apr 2019 04:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726372AbfDIEyM (ORCPT ); Tue, 9 Apr 2019 00:54:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50290 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfDIEyL (ORCPT ); Tue, 9 Apr 2019 00:54:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD542308626F for ; Tue, 9 Apr 2019 04:54:11 +0000 (UTC) Received: from dhcp-12-125.nay.redhat.com (dhcp-12-125.nay.redhat.com [10.66.12.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCC3B19C5B for ; Tue, 9 Apr 2019 04:54:10 +0000 (UTC) From: Zorro Lang To: fstests@vger.kernel.org Subject: [PATCH] src/t_attr_corruption: covert value to little endian order Date: Tue, 9 Apr 2019 12:54:04 +0800 Message-Id: <20190409045404.20215-1-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 09 Apr 2019 04:54:11 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP generic/529 always fails on ppc64 or s390x big-endian machine as: set posix acl: Operation not supported Due to the members of struct posix_acl_xattr_entry/header need to be little-endian byte order, so use htole*() helper to make sure that. Signed-off-by: Zorro Lang Reviewed-by: Darrick J. Wong --- src/t_attr_corruption.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/t_attr_corruption.c b/src/t_attr_corruption.c index 9101024e..e7d435b1 100644 --- a/src/t_attr_corruption.c +++ b/src/t_attr_corruption.c @@ -32,6 +32,7 @@ #include #include #include +#include void die(const char *msg) { @@ -52,13 +53,14 @@ struct myacl { int main(int argc, char *argv[]) { + /* posix_acl_xattr_entry/header need little-endian order */ struct myacl acl = { - .d = 2, + .d = htole32(2), .e = { - {1, 0, 0}, - {4, 0, 0}, - {0x10, 0, 0}, - {0x20, 0, 0}, + {htole16(1), 0, 0}, + {htole16(4), 0, 0}, + {htole16(0x10), 0, 0}, + {htole16(0x20), 0, 0}, }, }; char buf[64];