All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: aalbersh@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/9] makecfg: handle metadir quota options
Date: Fri, 11 Sep 2026 10:58:54 -0700	[thread overview]
Message-ID: <20260911175854.GL6265@frogsfrogsfrogs> (raw)
In-Reply-To: <aqQi1BNvhModkvb1@infradead.org>

On Fri, Sep 11, 2026 at 08:48:36AM -0700, Christoph Hellwig wrote:
> On Tue, Sep 08, 2026 at 11:01:33PM -0700, Darrick J. Wong wrote:
> >  
> > +/* These should correspond to XFS_[UGP]UOTA_{ACCT,ENFD} */
> 
> CAn we reuse those?  If not at least add the missing Q in QUOTA here :)

Oh!  Yes, we can just reuse them since xfs_log_format.h is in
/usr/include/xfs/.  Well that simplifies things a lot.

> > diff --git a/configure.ac b/configure.ac
> > index 40ccd88aa2a950..8a2505e37c70ab 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -195,6 +195,7 @@ if test "$have_listmount" = "yes"; then
> >  fi
> >  AC_HAVE_STATMOUNT_SUPPORTED_MASK
> >  AC_HAVE_FANOTIFY_MOUNTINFO
> > +AC_HAVE_QUOTACTL_FD
> 
> Shouldn't the AC_HAVE_QUOTACTL_FD go into a separate patch, including
> a generic helper?  I assume most other uqotactl users would prefer
> that as well when available.

Yes.  I could hoist xfsquotactl from quota/linux.c into libfrog, and
then adapt it to use quotactl_fd if available:

int
xfsquotactl(
	int			mnt_fd,
	const char		*device,
	enum xfs_quota_cmd	xcommand,
	uint			xtype,
	uint			id,
	void			*addr)
{
	const int		op = QCMD(xcommand_to_qcommand(xcommand),
					  xtype_to_qtype(xtype));
	int			ret = -1;

	errno = ENOSYS;
#ifdef HAVE_QUOTACTL_FD
	if (mnt_fd >= 0)
		ret = syscall(SYS_quotactl_fd, mnt_fd, op, id, addr);
#endif
	if (ret != -1 || errno != ENOSYS)
		return ret;

	return quotactl(op, device, id, addr);
}

This will require some amount of refactoring in xfs_quota, since it
doesn't currently try to open() the filesystem mountpoint.  OTOH now it
will no longer fail if a sysadmin does an lvrename while it's running.

However, doing all that got intense, so I'm splitting all that out into
a separate hoist/cleanup/adapt series.  For now, the get_qflags function
in spaceman will look like this:

	/* GETQSTAT returns qflags for all quota types, not just user */
	ret = quotactl(QCMD(Q_XGETQSTAT, USRQUOTA), f->fs_path.fs_name, 0,
			(void *)&qstat);

until the new series ports it to xfsquotactl.

> Otherwise this looks good from a quick look.

--D

  reply	other threads:[~2026-09-11 17:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  6:00 [PATCHSET v3] xfsprogs: generate mkfs.xfs config files Darrick J. Wong
2026-09-09  6:00 ` [PATCH 1/9] mkfs: automatically upgrade autofsck earlier Darrick J. Wong
2026-09-11 15:12   ` Christoph Hellwig
2026-09-09  6:00 ` [PATCH 2/9] mkfs: print config file for a given mkfs configuration Darrick J. Wong
2026-09-11 15:14   ` Christoph Hellwig
2026-09-11 16:08     ` Darrick J. Wong
2026-09-09  6:01 ` [PATCH 3/9] xfs_db: print configuration file for mounted filesystems Darrick J. Wong
2026-09-11 15:14   ` Christoph Hellwig
2026-09-09  6:01 ` [PATCH 4/9] xfs_spaceman: " Darrick J. Wong
2026-09-11 15:15   ` Christoph Hellwig
2026-09-09  6:01 ` [PATCH 5/9] makecfg: handle metadir quota options Darrick J. Wong
2026-09-09 13:15   ` Andrey Albershteyn
2026-09-11 15:48   ` Christoph Hellwig
2026-09-11 17:58     ` Darrick J. Wong [this message]
2026-09-09  6:01 ` [PATCH 6/9] makecfg: handle old V4 options that are almost always on by default Darrick J. Wong
2026-09-09 13:15   ` Andrey Albershteyn
2026-09-11 15:49   ` Christoph Hellwig
2026-09-11 16:03     ` Darrick J. Wong
2026-09-09  6:02 ` [PATCH 7/9] makecfg: add a few more file related options Darrick J. Wong
2026-09-09 13:16   ` Andrey Albershteyn
2026-09-11 15:49   ` Christoph Hellwig
2026-09-11 16:04     ` Darrick J. Wong
2026-09-09  6:02 ` [PATCH 8/9] xfs_admin: print configuration file for mounted filesystems Darrick J. Wong
2026-09-11 15:50   ` Christoph Hellwig
2026-09-09  6:02 ` [PATCH 9/9] mkfs: allow specification of default options via configuration file Darrick J. Wong
2026-09-10 11:23   ` Andrey Albershteyn
2026-09-10 15:17     ` Darrick J. Wong
2026-09-10 15:37       ` Andrey Albershteyn
2026-09-10 16:06         ` Darrick J. Wong
2026-09-10 16:38           ` Andrey Albershteyn
2026-09-11  4:43   ` [PATCH v3.1 " Darrick J. Wong
2026-09-11 15:51     ` Christoph Hellwig

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=20260911175854.GL6265@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /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.