public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHBOMB v30.10] xfsprogs-6.10: filesystem properties
@ 2024-08-06 18:14 Darrick J. Wong
  2024-08-06 18:18 ` [PATCHSET v30.10 1/3] xfsprogs: " Darrick J. Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Darrick J. Wong @ 2024-08-06 18:14 UTC (permalink / raw)
  To: Christoph Hellwig, Dave Chinner; +Cc: xfs, fstests

Hi all,

After recent discussions about how to allow sysadmins to opt in or out
of automatick fsck for XFS[1][2], I now have a patchset for xfsprogs
6.10 that implements the filesystem properties that we talked about.

As a refresher, the design I settled on is to add ATTR_ROOT (aka
"trusted") xattrs to the root directory.  ATTR_ROOT xattrs can only be
accessed by processes with CAP_SYS_ADMIN, so unprivileged userspace
can't mess with the sysadmin's configured preferences.

I decided that all fs properties should have "xfs:" in the name to make
them look distinct, and defined "trusted.xfs:autofsck" as the property
that controls the behavior of automatic fsck.  There's a new wrapper
program "xfs_property" that one can use to administer the properties.
xfs_scrub{,bed} uses the property; and mkfs.xfs can set it for you at
format time.

# mkfs.xfs -m autofsck /dev/sda

# xfs_property /dev/sda get autofsck
repair

# mount /dev/sda /mnt

# xfs_property /mnt set autofsck=check

# xfs_scrub -o autofsck /mnt
Info: /mnt: Checking per autofsck directive.

--D

[1] https://lore.kernel.org/linux-xfs/20240724213852.GA612460@frogsfrogsfrogs/
[2] https://lore.kernel.org/linux-xfs/20240730031030.GA6333@frogsfrogsfrogs/

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [PATCHSET v30.9 1/3] xfsprogs: filesystem properties
@ 2024-07-30  3:18 Darrick J. Wong
  2024-07-30  3:21 ` [PATCH 7/7] xfs_property: add a new tool to administer fs properties Darrick J. Wong
  0 siblings, 1 reply; 34+ messages in thread
From: Darrick J. Wong @ 2024-07-30  3:18 UTC (permalink / raw)
  To: djwong, cem; +Cc: linux-xfs

Hi all,

It would be very useful if system administrators could set properties for a
given xfs filesystem to control its behavior.  This we can do easily and
extensibly by setting ATTR_ROOT (aka "trusted") extended attributes on the root
directory.  To prevent this from becoming a weird free for all, let's add some
library and tooling support so that sysadmins simply run the xfs_property
program to administer these properties.

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

This has been running on the djcloud for months with no problems.  Enjoy!
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=filesystem-properties

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=filesystem-properties
---
Commits in this patchset:
 * libfrog: support editing filesystem property sets
 * xfs_spaceman: edit filesystem properties
 * xfs_db: improve getting and setting extended attributes
 * libxfs: hoist listxattr from xfs_repair
 * libxfs: pass a transaction context through listxattr
 * xfs_db: add a command to list xattrs
 * xfs_property: add a new tool to administer fs properties
---
 db/attrset.c            |  463 ++++++++++++++++++++++++++++++++++++++++++++++-
 libfrog/Makefile        |    7 +
 libfrog/fsproperties.c  |   39 ++++
 libfrog/fsproperties.h  |   50 +++++
 libfrog/fsprops.c       |  214 ++++++++++++++++++++++
 libfrog/fsprops.h       |   34 +++
 libxfs/Makefile         |    2 
 libxfs/listxattr.c      |   42 ++--
 libxfs/listxattr.h      |   17 ++
 man/man8/xfs_db.8       |   68 +++++++
 man/man8/xfs_property.8 |   52 +++++
 man/man8/xfs_spaceman.8 |   27 +++
 repair/Makefile         |    2 
 repair/listxattr.h      |   15 --
 repair/pptr.c           |    9 +
 spaceman/Makefile       |    7 +
 spaceman/init.c         |    1 
 spaceman/properties.c   |  342 +++++++++++++++++++++++++++++++++++
 spaceman/space.h        |    1 
 spaceman/xfs_property   |   77 ++++++++
 20 files changed, 1422 insertions(+), 47 deletions(-)
 create mode 100644 libfrog/fsproperties.c
 create mode 100644 libfrog/fsproperties.h
 create mode 100644 libfrog/fsprops.c
 create mode 100644 libfrog/fsprops.h
 rename repair/listxattr.c => libxfs/listxattr.c (84%)
 create mode 100644 libxfs/listxattr.h
 create mode 100644 man/man8/xfs_property.8
 delete mode 100644 repair/listxattr.h
 create mode 100644 spaceman/properties.c
 create mode 100755 spaceman/xfs_property


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

end of thread, other threads:[~2024-08-07 16:43 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 18:14 [PATCHBOMB v30.10] xfsprogs-6.10: filesystem properties Darrick J. Wong
2024-08-06 18:18 ` [PATCHSET v30.10 1/3] xfsprogs: " Darrick J. Wong
2024-08-06 18:19   ` [PATCH 1/7] libfrog: support editing filesystem property sets Darrick J. Wong
2024-08-06 18:19   ` [PATCH 2/7] xfs_io: edit filesystem properties Darrick J. Wong
2024-08-07 16:08     ` Christoph Hellwig
2024-08-06 18:20   ` [PATCH 3/7] xfs_db: improve getting and setting extended attributes Darrick J. Wong
2024-08-07 16:10     ` Christoph Hellwig
2024-08-07 16:43       ` Darrick J. Wong
2024-08-06 18:20   ` [PATCH 4/7] libxfs: hoist listxattr from xfs_repair Darrick J. Wong
2024-08-06 18:20   ` [PATCH 5/7] libxfs: pass a transaction context through listxattr Darrick J. Wong
2024-08-06 18:20   ` [PATCH 6/7] xfs_db: add a command to list xattrs Darrick J. Wong
2024-08-06 18:21   ` [PATCH 7/7] xfs_property: add a new tool to administer fs properties Darrick J. Wong
2024-08-07 16:10     ` Christoph Hellwig
2024-08-06 18:18 ` [PATCHSET v30.10 2/3] xfs_scrub: admin control of automatic fsck Darrick J. Wong
2024-08-06 18:21   ` [PATCH 1/4] libfrog: define a autofsck filesystem property Darrick J. Wong
2024-08-07 16:11     ` Christoph Hellwig
2024-08-06 18:21   ` [PATCH 2/4] xfs_scrub: allow sysadmin to control background scrubs Darrick J. Wong
2024-08-07 16:12     ` Christoph Hellwig
2024-08-06 18:21   ` [PATCH 3/4] xfs_scrub: use the autofsck fsproperty to select mode Darrick J. Wong
2024-08-07 16:12     ` Christoph Hellwig
2024-08-06 18:22   ` [PATCH 4/4] mkfs: set autofsck filesystem property Darrick J. Wong
2024-08-07 16:13     ` Christoph Hellwig
2024-08-06 18:19 ` [PATCHSET v30.10 3/3] debian: enable xfs_scrub_all by default Darrick J. Wong
2024-08-06 18:22   ` [PATCH 1/1] debian: enable xfs_scrub_all systemd timer services " Darrick J. Wong
2024-08-07 16:13     ` Christoph Hellwig
2024-08-06 18:19 ` [PATCHSET v30.10] fstests: xfs filesystem properties Darrick J. Wong
2024-08-06 18:22   ` [PATCH 1/1] xfs: functional testing for " Darrick J. Wong
2024-08-07 16:13     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2024-07-30  3:18 [PATCHSET v30.9 1/3] xfsprogs: " Darrick J. Wong
2024-07-30  3:21 ` [PATCH 7/7] xfs_property: add a new tool to administer fs properties Darrick J. Wong
2024-07-30 21:43   ` Christoph Hellwig
2024-07-30 22:28     ` Darrick J. Wong
2024-07-31 15:42       ` Christoph Hellwig
2024-07-31 17:56         ` Darrick J. Wong
2024-08-02  0:25   ` Dave Chinner

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