linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v31.1 2/2] fstests: atomic file content commits
@ 2024-10-01 16:48 Darrick J. Wong
  2024-10-01 16:49 ` [PATCH 1/2] src/fiexchange.h: add the start-commit/commit-range ioctls Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Darrick J. Wong @ 2024-10-01 16:48 UTC (permalink / raw)
  To: zlang, djwong; +Cc: fstests, linux-xfs

Hi all,

This series creates XFS_IOC_START_COMMIT and XFS_IOC_COMMIT_RANGE ioctls
to perform the exchange only if the target file has not been changed
since a given sampling point.

This new functionality uses the mechanism underlying EXCHANGE_RANGE to
stage and commit file updates such that reader programs will see either
the old contents or the new contents in their entirety, with no chance
of torn writes.  A successful call completion guarantees that the new
contents will be seen even if the system fails.  The pair of ioctls
allows userspace to perform what amounts to a compare and exchange
operation on entire file contents.

Note that there are ongoing arguments in the community about how best to
implement some sort of file data write counter that nfsd could also use
to signal invalidations to clients.  Until such a thing is implemented,
this patch will rely on ctime/mtime updates.

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

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=atomic-file-commits

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=atomic-file-commits

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=atomic-file-commits
---
Commits in this patchset:
 * src/fiexchange.h: add the start-commit/commit-range ioctls
 * xfs/122: add tests for commitrange structures
---
 m4/package_xfslibs.m4 |    2 ++
 src/fiexchange.h      |   26 ++++++++++++++++++++++++++
 src/global.h          |    4 ++++
 tests/xfs/122.out     |    1 +
 4 files changed, 33 insertions(+)


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

end of thread, other threads:[~2024-10-12 14:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 16:48 [PATCHSET v31.1 2/2] fstests: atomic file content commits Darrick J. Wong
2024-10-01 16:49 ` [PATCH 1/2] src/fiexchange.h: add the start-commit/commit-range ioctls Darrick J. Wong
2024-10-02  5:45   ` Christoph Hellwig
2024-10-01 16:49 ` [PATCH 2/2] xfs/122: add tests for commitrange structures Darrick J. Wong
2024-10-02  5:45   ` Christoph Hellwig
2024-10-02 22:47     ` Darrick J. Wong
2024-10-03 12:10       ` Christoph Hellwig
2024-10-11  6:28       ` Zorro Lang
2024-10-11 18:19         ` Darrick J. Wong
2024-10-12 14:05           ` Zorro Lang
2024-10-03 21:37 ` [PATCH] fsstress: add support for FALLOC_FL_UNSHARE_RANGE Darrick J. Wong
2024-10-07 13:18   ` Brian Foster
2024-10-11  5:13   ` Zorro Lang
2024-10-11  5:21     ` Zorro Lang
2024-10-11 16:08       ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).