All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fs, xfs: block map immutable files for dax, dma-to-storage, and swap
@ 2017-07-29 19:43 ` Dan Williams
  0 siblings, 0 replies; 39+ messages in thread
From: Dan Williams @ 2017-07-29 19:43 UTC (permalink / raw)
  To: darrick.wong
  Cc: Jan Kara, linux-nvdimm, Dave Chinner, linux-kernel, linux-xfs,
	Alexander Viro, luto, linux-fsdevel, Christoph Hellwig

tl;dr: The proposed S_IOMAP_IMMUTABLE mechanism

The daxfile proposal a few weeks back [1] sought to piggy back on the
swapfile implementation to approximate a block map immutable file. This
is an idea Dave originated last year to solve the dax "flush from
userspace" problem [2].

The discussion yielded several results. First, Christoph pointed out that
swapfiles are subtly broken [3].  Second, Darrick [4]
and Dave [5] proposed how to properly implement a block map immutable file.
Finally, Dave identified some improvements to swapfiles that can be
built on the block-map-immutable mecahanism. These patches seek to
implement the first part of the proposal and save the swapfile work to
build on top once the base mechanism is complete.

While the initial motivation for this feature is support for
byte-addressable updates of persistent memory and managing cache
maintenance from userspace, the applications of the feature are broader.
In addition to being the start of a better swapfile mechanism it can
also support a DMA-to-storage use case.  This use case enables
data-acquisition hardware to DMA directly to a storage device address
while being safe in the knowledge that storage mappings will not change.

These patches are relative to Darrick's 'devel' tree. Patch 3 is likely
wrong in the way it sets the new XFS_DIFLAG2_IOMAP_IMMUTABLE flag, but
seems to work with a basic test. The test just turns the flag on and
off, checks that the file is fully allocated and immutable, and
validates that the state persists over a umount / mount cycle. A proper
xfstest is in the works, but comments on this first draft are welcome.

[1]: https://lkml.org/lkml/2017/6/16/790
[2]: https://lkml.org/lkml/2016/9/11/159
[3]: https://lkml.org/lkml/2017/6/18/31
[4]: https://lkml.org/lkml/2017/6/20/49
[5]: https://www.spinics.net/lists/linux-xfs/msg07871.html

---

Dan Williams (3):
      fs, xfs: introduce S_IOMAP_IMMUTABLE
      fs, xfs: introduce FALLOC_FL_SEAL_BLOCK_MAP
      xfs: persist S_IOMAP_IMMUTABLE in di_flags2


 fs/attr.c                   |   10 ++++
 fs/namei.c                  |    3 +
 fs/open.c                   |   28 ++++++++++++
 fs/read_write.c             |    3 +
 fs/xfs/libxfs/xfs_format.h  |    5 ++
 fs/xfs/xfs_bmap_util.c      |   98 ++++++++++++++++++++++++++++++++++++++++++-
 fs/xfs/xfs_bmap_util.h      |    4 +-
 fs/xfs/xfs_file.c           |   14 ++++--
 fs/xfs/xfs_ioctl.c          |   10 ++++
 fs/xfs/xfs_iops.c           |    8 ++--
 include/linux/falloc.h      |    3 +
 include/linux/fs.h          |    2 +
 include/uapi/linux/falloc.h |   19 ++++++++
 mm/filemap.c                |    9 ++++
 14 files changed, 200 insertions(+), 16 deletions(-)
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2017-08-05  9:46 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-29 19:43 [PATCH 0/3] fs, xfs: block map immutable files for dax, dma-to-storage, and swap Dan Williams
2017-07-29 19:43 ` Dan Williams
2017-07-29 19:43 ` [PATCH 1/3] fs, xfs: introduce S_IOMAP_IMMUTABLE Dan Williams
2017-07-29 19:43   ` Dan Williams
2017-07-31 16:02   ` Colin Walters
2017-07-31 16:02     ` Colin Walters
2017-07-31 16:29     ` Dan Williams
2017-07-31 16:29       ` Dan Williams
2017-07-31 16:32       ` Colin Walters
2017-07-31 16:32         ` Colin Walters
2017-07-31 17:42         ` Colin Walters
2017-07-31 17:42           ` Colin Walters
2017-07-31 18:23           ` Darrick J. Wong
2017-07-31 18:23             ` Darrick J. Wong
2017-08-01  2:15             ` Colin Walters
2017-08-01  2:15               ` Colin Walters
2017-08-01  2:42               ` Dave Chinner
2017-08-01  2:42                 ` Dave Chinner
2017-08-05  9:45                 ` Christoph Hellwig
2017-08-05  9:45                   ` Christoph Hellwig
2017-07-31 16:46   ` Darrick J. Wong
2017-07-31 16:46     ` Darrick J. Wong
2017-07-31 17:32     ` Dan Williams
2017-07-31 17:32       ` Dan Williams
2017-07-29 19:43 ` [PATCH 2/3] fs, xfs: introduce FALLOC_FL_SEAL_BLOCK_MAP Dan Williams
2017-07-29 19:43   ` Dan Williams
2017-07-29 19:43   ` Dan Williams
2017-07-31 17:09   ` Darrick J. Wong
2017-07-31 17:09     ` Darrick J. Wong
2017-07-31 18:25     ` Dan Williams
2017-07-31 18:25       ` Dan Williams
2017-08-01  0:30       ` Dave Chinner
2017-08-01  0:30         ` Dave Chinner
2017-07-29 19:43 ` [PATCH 3/3] xfs: persist S_IOMAP_IMMUTABLE in di_flags2 Dan Williams
2017-07-29 19:43   ` Dan Williams
2017-07-31 17:15   ` Darrick J. Wong
2017-07-31 17:15     ` Darrick J. Wong
2017-08-01  0:42   ` Dave Chinner
2017-08-01  0:42     ` Dave Chinner

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.