[PATCH v3 0/5] minix: convert to iomap and add direct I/O

Jeremy Bingham posted 5 patches 2 weeks ago
fs/iomap/buffered-io.c  |  31 ++++++++
fs/minix/file.c         | 153 ++++++++++++++++++++++++++++++++++++++--
fs/minix/inode.c        |  87 +++++++++++++++++++----
fs/minix/iomap.c        | 122 ++++++++++++++++++++++++++++++++
fs/minix/itree_common.c |  11 ++-
fs/minix/itree_v1.c     |  25 ++++++-
fs/minix/itree_v2.c     |  17 ++++-
fs/minix/minix.h        |  24 ++++++-
fs/minix/namei.c        |   8 ++-
include/linux/iomap.h   |   4 ++
10 files changed, 457 insertions(+), 25 deletions(-)
create mode 100644 fs/minix/iomap.c
[PATCH v3 0/5] minix: convert to iomap and add direct I/O
Posted by Jeremy Bingham 2 weeks ago
This is version 3 of the minix iomap conversion patch series. Versions 1
and 2 both had issues that syzbot found while testing, while Darrick J.
Wong gave some critiques of the version 2 patches that I have addressed
here.

This patch series converts the minix filesystem module from using the
buffer_head based path to the iomap API, and adds direct I/O support in
the process.

Patch 1 adds a new iomap_symlink_write function to
fs/iomap/buffered-io.c. This allows minix's symlinks to be written and
read without bypassing iomap entirely. (I considered whether this ought
to be broken out as its own patch since it's outside of fs/minix, but
decided that since it was suggested as part of this and is a necessary
piece that I would include it unless told otherwise.) This was suggested
by Darrick J. Wong, who also provided an initial implementation that I
only had to modify slightly.

Patch 2 adds the base iomap functions in fs/minix/iomap.c. This provides
the iomap begin/end functions which sit at the base of the rest of this.

Patch 3 wires iomap.c into the itree*.c files, adds version specific
helper functions, and moves the old buffer_head based functions over to
new names to support directory operations.

Patch 4 adds the new iomap file operations functions to file.c,
including the direct i/o functions.

Patch 5 updates the inode operations to use iomap, except for directory
operations which work the old way. The minix_symlink function in namei.c
is also updated to use the new iomap_write_symlink function.

Changes since v2:
  * Reorganized the patches entirely.
  * Addressed Darrick Wong's critiques of v2:
    - Added a new iomap_symlink_write function per his suggestion.
    - Removed the minix custom __page_symlink function that replaced the
      usual page_symlink function and the changes to minix_get_link that
      allowed symlinks to be written and read by bypassing iomap
      entirely. This ended up also removing both the issue syzbot found
      in v2 of the patch and the fix for it.
    - Reworked minix_iomap_begin to remove the nest of gotos inherited
      from get_block to use helper functions instead.
    - Pared down some unnecessary comments.
    - Dropped bmap entirely.
    - Dropped IOMAP_F_MERGED in minix_iomap_begin since there aren't any
      merged blocks to worry about.
    - Removed unneeded manual page cache invalidation.

This patch series has been verified to compile cleanly between each
patch and has been tested with a script that exercises mounting,
unmounting, file creation/writing/reading/verification, directory
creation and listing, symlink creation/reading/following, hard links,
file truncation (both shrinking and growing), deep directory nesting,
large files that span multiple blocks and indirect blocks for both size
and content, deleting files and directories, persistence, and that
fsck.minix behaves as expected for all versions of the minix filesystem.

Unfortunately, no version of the minix fs module can support an xfstests
run; all of the tests either fail (seemingly for reasons unrelated to
the module itself) or aren't run because minix doesn't support the
features in question. Getting xfstests to run would be nice, but either
requires or would be greatly helped by making changes to minix's mkfs
and fsck programs. It would definitely be a nice-to-have, but is outside
the scope of this series.

Jeremy Bingham (5):
  iomap: add iomap_symlink_write
  minix: add base iomap begin/end functions
  minix: update itree* files to add iomap functions
  minix: add file operation functions
  minix: iomap inode operations

 fs/iomap/buffered-io.c  |  31 ++++++++
 fs/minix/file.c         | 153 ++++++++++++++++++++++++++++++++++++++--
 fs/minix/inode.c        |  87 +++++++++++++++++++----
 fs/minix/iomap.c        | 122 ++++++++++++++++++++++++++++++++
 fs/minix/itree_common.c |  11 ++-
 fs/minix/itree_v1.c     |  25 ++++++-
 fs/minix/itree_v2.c     |  17 ++++-
 fs/minix/minix.h        |  24 ++++++-
 fs/minix/namei.c        |   8 ++-
 include/linux/iomap.h   |   4 ++
 10 files changed, 457 insertions(+), 25 deletions(-)
 create mode 100644 fs/minix/iomap.c

-- 
2.47.3
Re: [PATCH v3 0/5] minix: convert to iomap and add direct I/O
Posted by Christoph Hellwig 1 week, 5 days ago
On Sat, Jul 11, 2026 at 01:59:04PM -0700, Jeremy Bingham wrote:
> This is version 3 of the minix iomap conversion patch series. Versions 1
> and 2 both had issues that syzbot found while testing, while Darrick J.
> Wong gave some critiques of the version 2 patches that I have addressed
> here.
> 
> This patch series converts the minix filesystem module from using the
> buffer_head based path to the iomap API, and adds direct I/O support in
> the process.
> 
> Patch 1 adds a new iomap_symlink_write function to

There's no point explaining each patch in the over letter, that's
what the commit log for each patch are for.

How did you test this?  How do the xfstests auto group results look
with an without the series for minix?
Re: [PATCH v3 0/5] minix: convert to iomap and add direct I/O
Posted by Jeremy Bingham 1 week, 5 days ago
On Mon, Jul 13, 2026 at 2:32 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Sat, Jul 11, 2026 at 01:59:04PM -0700, Jeremy Bingham wrote:
>
> There's no point explaining each patch in the over letter, that's
> what the commit log for each patch are for.

Understood. I've also read your other reply about how the cover letter
and commits need to explain *why* rather than *how* and will fix
them accordingly.

> How did you test this?  How do the xfstests auto group results look
> with an without the series for minix?

I made a script that exercises about 40 different file and directory
operations against each version of the minix filesystem. I tried running
xfstests against minix with and without these patches, but it doesn't
work under either case because mkfs.minix and fsck.minix don't take
the expected arguments. I had backed off using xfstests for this
because of that, but I'll revisit with the next round of changes.

Thank you again for your comments,

-j
Re: [PATCH v3 0/5] minix: convert to iomap and add direct I/O
Posted by Darrick J. Wong 1 week, 4 days ago
On Mon, Jul 13, 2026 at 12:26:27PM -0700, Jeremy Bingham wrote:
> On Mon, Jul 13, 2026 at 2:32 AM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Sat, Jul 11, 2026 at 01:59:04PM -0700, Jeremy Bingham wrote:
> >
> > There's no point explaining each patch in the over letter, that's
> > what the commit log for each patch are for.
> 
> Understood. I've also read your other reply about how the cover letter
> and commits need to explain *why* rather than *how* and will fix
> them accordingly.
> 
> > How did you test this?  How do the xfstests auto group results look
> > with an without the series for minix?
> 
> I made a script that exercises about 40 different file and directory
> operations against each version of the minix filesystem. I tried running
> xfstests against minix with and without these patches, but it doesn't
> work under either case because mkfs.minix and fsck.minix don't take
> the expected arguments. I had backed off using xfstests for this
> because of that, but I'll revisit with the next round of changes.

Yes, please do get fstests working /before/ you start changing critical
file IO paths.

--D

> Thank you again for your comments,
> 
> -j