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

Hi all,

After last week's discussion about how to allow sysadmins to opt in or
out of autonomous self healing XFS[1], I now have an RFC patchset 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:self_healing" as the
property that controls the amount of autonomous self healing.  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 self_healing /dev/sda

# xfs_property /dev/sda get self_healing
repair

# mount /dev/sda /mnt

# xfs_property /mnt set self_healing=check

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

--D

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

^ permalink raw reply	[flat|nested] 43+ messages in thread
* [PATCHSET v30.10 1/3] xfsprogs: filesystem properties
@ 2024-08-06 18:18 Darrick J. Wong
  2024-08-06 18:21 ` [PATCH 7/7] xfs_property: add a new tool to administer fs properties Darrick J. Wong
  0 siblings, 1 reply; 43+ messages in thread
From: Darrick J. Wong @ 2024-08-06 18:18 UTC (permalink / raw)
  To: djwong, cem
  Cc: Dave Chinner, Christoph Hellwig, Dave Chinner, Christoph Hellwig,
	hch, dchinner, fstests, 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.

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=filesystem-properties-6.10
---
Commits in this patchset:
 * libfrog: support editing filesystem property sets
 * xfs_io: 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 ++++++++++++++++++++++++++++++++++++++++++++++-
 io/Makefile             |    4 
 io/fsproperties.c       |  365 +++++++++++++++++++++++++++++++++++++
 io/init.c               |    1 
 io/io.h                 |    1 
 io/xfs_property         |   77 ++++++++
 libfrog/Makefile        |    7 +
 libfrog/fsproperties.c  |   39 ++++
 libfrog/fsproperties.h  |   53 +++++
 libfrog/fsprops.c       |  202 +++++++++++++++++++++
 libfrog/fsprops.h       |   34 +++
 libxfs/Makefile         |    2 
 libxfs/listxattr.c      |   42 ++--
 libxfs/listxattr.h      |   17 ++
 man/man8/xfs_db.8       |   68 +++++++
 man/man8/xfs_io.8       |   16 ++
 man/man8/xfs_property.8 |   61 ++++++
 repair/Makefile         |    2 
 repair/listxattr.h      |   15 --
 repair/pptr.c           |    9 +
 20 files changed, 1430 insertions(+), 48 deletions(-)
 create mode 100644 io/fsproperties.c
 create mode 100755 io/xfs_property
 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


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

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

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30  3:10 [RFC PATCHSET] xfsprogs: filesystem properties Darrick J. Wong
2024-07-30  3:18 ` [PATCHSET v30.9 1/3] " Darrick J. Wong
2024-07-30  3:19   ` [PATCH 1/7] libfrog: support editing filesystem property sets Darrick J. Wong
2024-07-30 21:40     ` Christoph Hellwig
2024-07-30  3:20   ` [PATCH 2/7] xfs_spaceman: edit filesystem properties Darrick J. Wong
2024-07-30 21:41     ` Christoph Hellwig
2024-07-30 22:37       ` Darrick J. Wong
2024-07-31 15:41         ` Christoph Hellwig
2024-08-02  0:16           ` Dave Chinner
2024-07-30  3:20   ` [PATCH 3/7] xfs_db: improve getting and setting extended attributes Darrick J. Wong
2024-07-30 21:37     ` Christoph Hellwig
2024-07-30  3:20   ` [PATCH 4/7] libxfs: hoist listxattr from xfs_repair Darrick J. Wong
2024-07-30 21:38     ` Christoph Hellwig
2024-07-31 17:55       ` Darrick J. Wong
2024-07-30  3:21   ` [PATCH 5/7] libxfs: pass a transaction context through listxattr Darrick J. Wong
2024-07-30 21:38     ` Christoph Hellwig
2024-07-30  3:21   ` [PATCH 6/7] xfs_db: add a command to list xattrs Darrick J. Wong
2024-07-30 21:39     ` Christoph Hellwig
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
2024-07-30  3:19 ` [PATCHSET v30.9 2/3] xfs_scrub: control of autonomous self healing Darrick J. Wong
2024-07-30  3:21   ` [PATCH 1/3] libfrog: define a self_healing filesystem property Darrick J. Wong
2024-07-30 21:56     ` Christoph Hellwig
2024-07-30 23:51       ` Darrick J. Wong
2024-07-31 15:43         ` Christoph Hellwig
2024-07-31 17:45           ` Darrick J. Wong
2024-07-31 19:43             ` Christoph Hellwig
2024-07-30  3:22   ` [PATCH 2/3] xfs_scrub: allow sysadmin to control background scrubs Darrick J. Wong
2024-07-30  3:22   ` [PATCH 3/3] mkfs: set self_healing property Darrick J. Wong
2024-07-30  3:19 ` [PATCHSET v30.9 3/3] xfs_scrub: separate package for self healing Darrick J. Wong
2024-07-30  3:22   ` [PATCH 1/3] misc: shift install targets Darrick J. Wong
2024-07-30  3:22   ` [PATCH 2/3] xfs_scrub: use the self_healing fsproperty to select mode Darrick J. Wong
2024-07-30  3:23   ` [PATCH 3/3] debian: create a new package for automatic self-healing Darrick J. Wong
2024-07-30  3:19 ` [PATCHSET v30.9] fstests: xfs filesystem properties Darrick J. Wong
2024-07-30  3:23   ` [PATCH 1/1] xfs: functional testing for " Darrick J. Wong
2024-07-30  3:25   ` [PATCHSET v30.9] fstests: xfs " Darrick J. Wong
2024-08-02  0:29 ` [RFC PATCHSET] xfsprogs: " Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2024-08-06 18:18 [PATCHSET v30.10 1/3] " 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

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