From patchwork Sat Sep 17 01:00:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9336885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76B1C607FF for ; Sat, 17 Sep 2016 01:00:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EF5529B74 for ; Sat, 17 Sep 2016 01:00:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FC8C29B8B; Sat, 17 Sep 2016 01:00:56 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C98A429B74 for ; Sat, 17 Sep 2016 01:00:55 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 549B37CA1; Fri, 16 Sep 2016 20:00:50 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 5294B7CA0 for ; Fri, 16 Sep 2016 20:00:47 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 25DF8304059 for ; Fri, 16 Sep 2016 18:00:43 -0700 (PDT) X-ASG-Debug-ID: 1474074042-0bf57c1b0a8557a0001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id h5vEd1K21pCUxaOW (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 16 Sep 2016 18:00:43 -0700 (PDT) X-Barracuda-Envelope-From: sandeen@redhat.com X-Barracuda-Effective-Source-IP: mx1.redhat.com[209.132.183.28] X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40E0DAB099; Sat, 17 Sep 2016 01:00:42 +0000 (UTC) Received: from Liberator.local (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8H10eO3016172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Sep 2016 21:00:41 -0400 To: xfs-oss , linux-xfs@vger.kernel.org From: Eric Sandeen Subject: [PATCH] xfs_io: allow chattr & chproj on foreign filesystems Message-ID: X-ASG-Orig-Subj: [PATCH] xfs_io: allow chattr & chproj on foreign filesystems Date: Fri, 16 Sep 2016 20:00:39 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 17 Sep 2016 01:00:42 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1474074042 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1177 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP Now that FS_IOC_FSSETXATTR is a generic vfs call, these functions can be used on non-xfs filesystems, and this is needed for generic project quota testing. (not all flags are valid on all filesystems.) Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig diff --git a/io/attr.c b/io/attr.c index 0186b1d..d1962f3 100644 --- a/io/attr.c +++ b/io/attr.c @@ -340,7 +340,7 @@ attr_init(void) chattr_cmd.args = _("[-R|-D] [+/-"CHATTR_XFLAG_LIST"]"); chattr_cmd.argmin = 1; chattr_cmd.argmax = -1; - chattr_cmd.flags = CMD_NOMAP_OK; + chattr_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK; chattr_cmd.oneline = _("change extended inode flags on the currently open file"); chattr_cmd.help = chattr_help; diff --git a/io/open.c b/io/open.c index a5d465a..3eaa013 100644 --- a/io/open.c +++ b/io/open.c @@ -929,7 +929,7 @@ open_init(void) chproj_cmd.args = _("[-D | -R] projid"); chproj_cmd.argmin = 1; chproj_cmd.argmax = -1; - chproj_cmd.flags = CMD_NOMAP_OK; + chproj_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK; chproj_cmd.oneline = _("change project identifier on the currently open file"); chproj_cmd.help = chproj_help;