All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Eric Sandeen <sandeen@redhat.com>
Cc: "Jan Kara" <jack@suse.cz>, "Petr Písař" <ppisar@redhat.com>,
	linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT
Date: Wed, 13 May 2020 11:19:39 +0200	[thread overview]
Message-ID: <20200513091939.GA27709@quack2.suse.cz> (raw)
In-Reply-To: <0dcda75e-0142-043f-2df2-9155cb6b7ed1@redhat.com>

On Fri 08-05-20 14:36:46, Eric Sandeen wrote:
> Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned
> timer information for the first quota type which was found to be
> enabled.
> 
> As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls")
> the kernel now honors the quota type requested, so send that from the
> Q_XFS_GETQSTAT calls in quota tools.
> 
> Older kernels ignore the type altogether, so this change should be
> backwards compatible with no change in behavior.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Thanks for the patch. I've added it to my tree.

								Honza

> ---
> 
> diff --git a/quotaio_xfs.c b/quotaio_xfs.c
> index 56daf89..b22c7b4 100644
> --- a/quotaio_xfs.c
> +++ b/quotaio_xfs.c
> @@ -81,7 +81,7 @@ static int xfs_init_io(struct quota_handle *h)
>  	struct xfs_mem_dqinfo info;
>  	int qcmd;
>  
> -	qcmd = QCMD(Q_XFS_GETQSTAT, 0);
> +	qcmd = QCMD(Q_XFS_GETQSTAT, h->qh_type);
>  	memset(&info, 0, sizeof(struct xfs_mem_dqinfo));
>  	if (quotactl(qcmd, h->qh_quotadev, 0, (void *)&info) < 0)
>  		return -1;
> diff --git a/quotaon_xfs.c b/quotaon_xfs.c
> index d557a75..d137240 100644
> --- a/quotaon_xfs.c
> +++ b/quotaon_xfs.c
> @@ -32,7 +32,7 @@ static int xfs_state_check(int qcmd, int type, int flags, const char *dev, int r
>  	if (flags & STATEFLAG_ALL)
>  		return 0;	/* noop */
>  
> -	if (quotactl(QCMD(Q_XFS_GETQSTAT, 0), dev, 0, (void *)&info) < 0) {
> +	if (quotactl(QCMD(Q_XFS_GETQSTAT, type), dev, 0, (void *)&info) < 0) {
>  		errstr(_("quotactl() on %s: %s\n"), dev, strerror(errno));
>  		return -1;
>  	}
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2020-05-13  9:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 19:36 [PATCH] quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT Eric Sandeen
2020-05-13  9:19 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200513091939.GA27709@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ppisar@redhat.com \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.