xfs
[Top] [All Lists]

[PATCH] xfs_io: allow chattr & chproj on foreign filesystems

To: xfs-oss <xfs@xxxxxxxxxxx>, linux-xfs@xxxxxxxxxxxxxxx
Subject: [PATCH] xfs_io: allow chattr & chproj on foreign filesystems
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Fri, 16 Sep 2016 20:00:39 -0500
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0
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 <sandeen@xxxxxxxxxx>
---

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;

<Prev in Thread] Current Thread [Next in Thread>