* [PATCH] xfs_quota: un-flag non-foreign-capable commands
@ 2016-09-15 22:58 Eric Sandeen
2016-09-16 13:31 ` Bill O'Donnell
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2016-09-15 22:58 UTC (permalink / raw)
To: linux-xfs, xfs-oss
The off command calls XFS_QUOTAOFF / Q_XQUOTAOFF, which calls
quota_disable in the kernel, which returns ENOSYS if the
->quota_enable quota op doesn't exist - and it does not exist
on any non-xfs filesystems.
We could get clever if we wanted it, and send Q_QUOTAOFF
instead for foreign filesystems, but for now it's broken
so just remove the flag.
The free command relies on XFS_IOC_FSGEOMETRY_V1, so unflag it
as well.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/quota/state.c b/quota/state.c
index 05e4ec5..09dfa70 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -584,7 +584,6 @@ state_init(void)
off_cmd.args = _("[-gpu] [-v]");
off_cmd.oneline = _("permanently switch quota off for a path");
off_cmd.help = off_help;
- off_cmd.flags = CMD_FLAG_FOREIGN_OK;
state_cmd.name = "state";
state_cmd.cfunc = state_f;
diff --git a/quota/free.c b/quota/free.c
index b9be954..3c8a5ce 100644
--- a/quota/free.c
+++ b/quota/free.c
@@ -372,7 +372,6 @@ free_init(void)
free_cmd.args = _("[-bir] [-hn] [-f file]");
free_cmd.oneline = _("show free and used counts for blocks and inodes");
free_cmd.help = free_help;
- free_cmd.flags = CMD_FLAG_FOREIGN_OK;
add_command(&free_cmd);
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfs_quota: un-flag non-foreign-capable commands
2016-09-15 22:58 [PATCH] xfs_quota: un-flag non-foreign-capable commands Eric Sandeen
@ 2016-09-16 13:31 ` Bill O'Donnell
0 siblings, 0 replies; 2+ messages in thread
From: Bill O'Donnell @ 2016-09-16 13:31 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs, xfs-oss
On Thu, Sep 15, 2016 at 05:58:26PM -0500, Eric Sandeen wrote:
> The off command calls XFS_QUOTAOFF / Q_XQUOTAOFF, which calls
> quota_disable in the kernel, which returns ENOSYS if the
> ->quota_enable quota op doesn't exist - and it does not exist
> on any non-xfs filesystems.
>
> We could get clever if we wanted it, and send Q_QUOTAOFF
> instead for foreign filesystems, but for now it's broken
> so just remove the flag.
>
> The free command relies on XFS_IOC_FSGEOMETRY_V1, so unflag it
> as well.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
> ---
>
> diff --git a/quota/state.c b/quota/state.c
> index 05e4ec5..09dfa70 100644
> --- a/quota/state.c
> +++ b/quota/state.c
> @@ -584,7 +584,6 @@ state_init(void)
> off_cmd.args = _("[-gpu] [-v]");
> off_cmd.oneline = _("permanently switch quota off for a path");
> off_cmd.help = off_help;
> - off_cmd.flags = CMD_FLAG_FOREIGN_OK;
>
> state_cmd.name = "state";
> state_cmd.cfunc = state_f;
> diff --git a/quota/free.c b/quota/free.c
> index b9be954..3c8a5ce 100644
> --- a/quota/free.c
> +++ b/quota/free.c
> @@ -372,7 +372,6 @@ free_init(void)
> free_cmd.args = _("[-bir] [-hn] [-f file]");
> free_cmd.oneline = _("show free and used counts for blocks and inodes");
> free_cmd.help = free_help;
> - free_cmd.flags = CMD_FLAG_FOREIGN_OK;
>
> add_command(&free_cmd);
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-16 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-15 22:58 [PATCH] xfs_quota: un-flag non-foreign-capable commands Eric Sandeen
2016-09-16 13:31 ` Bill O'Donnell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).