Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCHSET 2/2] xfsprogs: use quotactl_fd when possible
@ 2026-09-14  5:48 Darrick J. Wong
  2026-09-14  5:49 ` [PATCH 1/7] libfrog: hoist xfsquotactl out of xfs_quota Darrick J. Wong
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Darrick J. Wong @ 2026-09-14  5:48 UTC (permalink / raw)
  To: aalbersh, djwong; +Cc: linux-xfs

Hi all,

xfs_quota (really, quotactl()) has an interesting interface quirk in
that one passes a path to a block device in order to administer quotas
on a mounted filesystem.  Linux 5.17 added a new quotactl_fd syscall
so that one only has to have an open fd to the target filesystem.

Let's port xfsprogs to this new syscall because repeated path lookups
in xfs_quota mean that it's prone to failure if the device gets renamed
while it's running (e.g. lvm).  Weirder still, you can unmount the
filesystem while xfs_quota is running.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

With a bit of luck, this should all go splendidly.
Comments and questions are, as always, welcome.

--D

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=quotactl-fd
---
Commits in this patchset:
 * libfrog: hoist xfsquotactl out of xfs_quota
 * libfrog: clean up xfsquotactl a little bit
 * libfrog: enhance struct fs_path to store optional mount fd
 * libfrog: try to pass struct fs_path objects to quotactl wrapper
 * libfrog: add quotactl_fd support to xfsquotactl
 * xfs_quota: open the filesystem mountpoint for quota operations
 * xfs_spaceman: port makecfg to use xfsquotactl
---
 libfrog/paths.h       |    1 +
 libfrog/quotactl.h    |   30 ++++++++++++++++++++++++
 quota/init.h          |    2 ++
 quota/quota.h         |   18 +-------------
 configure.ac          |    1 +
 include/builddefs.in  |    1 +
 libfrog/Makefile      |    6 +++++
 libfrog/paths.c       |    3 ++
 libfrog/quotactl.c    |   45 +++++++++++++++++++++++++++---------
 m4/package_libcdev.m4 |   19 +++++++++++++++
 quota/Makefile        |    2 +-
 quota/edit.c          |   36 +++++++++++++++++------------
 quota/free.c          |   11 +++++----
 quota/init.c          |   15 ++++++++++++
 quota/path.c          |    4 ++-
 quota/project.c       |    7 ++++++
 quota/quota.c         |    6 +++--
 quota/report.c        |   61 ++++++++++++++++++++++++-------------------------
 quota/state.c         |   38 ++++++++++++++++++-------------
 spaceman/info.c       |    7 ++----
 20 files changed, 208 insertions(+), 105 deletions(-)
 create mode 100644 libfrog/quotactl.h
 rename quota/linux.c => libfrog/quotactl.c (53%)


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-09-16  8:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14  5:48 [PATCHSET 2/2] xfsprogs: use quotactl_fd when possible Darrick J. Wong
2026-09-14  5:49 ` [PATCH 1/7] libfrog: hoist xfsquotactl out of xfs_quota Darrick J. Wong
2026-09-15 12:24   ` Christoph Hellwig
2026-09-14  5:50 ` [PATCH 2/7] libfrog: clean up xfsquotactl a little bit Darrick J. Wong
2026-09-15 12:25   ` Christoph Hellwig
2026-09-14  5:50 ` [PATCH 3/7] libfrog: enhance struct fs_path to store optional mount fd Darrick J. Wong
2026-09-15 12:25   ` Christoph Hellwig
2026-09-14  5:50 ` [PATCH 4/7] libfrog: try to pass struct fs_path objects to quotactl wrapper Darrick J. Wong
2026-09-15 10:34   ` Andrey Albershteyn
2026-09-15 12:26     ` Christoph Hellwig
2026-09-15 16:15       ` Darrick J. Wong
2026-09-16  8:33         ` Andrey Albershteyn
2026-09-14  5:50 ` [PATCH 5/7] libfrog: add quotactl_fd support to xfsquotactl Darrick J. Wong
2026-09-15 12:27   ` Christoph Hellwig
2026-09-14  5:51 ` [PATCH 6/7] xfs_quota: open the filesystem mountpoint for quota operations Darrick J. Wong
2026-09-15 12:27   ` Christoph Hellwig
2026-09-14  5:51 ` [PATCH 7/7] xfs_spaceman: port makecfg to use xfsquotactl Darrick J. Wong
2026-09-15 12:28   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox