From: Jeremy Bingham <jbingham@gmail.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
brauner@kernel.org, jkoolstra@xs4all.nl, jack@suse.cz,
hch@infradead.org, viro@zeniv.linux.org.uk,
syzkaller@googlegroups.com
Subject: Re: [PATCH v2 3/4] minix: convert file operations to iomap and add
Date: Wed, 1 Jul 2026 11:42:45 -0700 [thread overview]
Message-ID: <CAMyBmMAFSXFcSt_KQNeVvfXRCbZ0twS60J5VLCVDsUfMHqce5g@mail.gmail.com> (raw)
In-Reply-To: <20260701182146.GD6507@frogsfrogsfrogs>
On Wed, Jul 1, 2026 at 11:21 AM Darrick J. Wong <djwong@kernel.org> wrote:
>
> On Sat, Jun 27, 2026 at 10:15:55PM -0700, Jeremy Bingham wrote:
> > Subject: [PATCH v2 3/4] minix: convert file operations to iomap and add
>
> ...add what?
Ugh, "add direct I/O". When I was preparing the second version of the patches,
I screwed up.
> > Replace generic_file_read_iter and generic_file_write_iter with custom
> > minix_file_read_iter and minix_file_write_iter that dispatch to iomap
> > for both buffered and direct I/O.
> >
> > Buffered writes now go through iomap_file_buffered_write instead of
> > the aops write_begin/write_end path (which no longer exists for
> > regular files). Buffered reads still use generic_file_read_iter
> > for the non-DIO case.
> >
> > Direct I/O is implemented via iomap_dio_rw for both reads and writes.
> > minix_dio_read_iter takes a shared inode lock; minix_dio_write_iter
> > takes an exclusive lock, does generic_write_checks, and falls back
> > to buffered writes via iomap_file_buffered_write for the tail of a
> > DIO write that is not block-aligned. The minix_dio_write_end_io
> > callback updates i_size and marks the inode dirty.
> >
> > minix_file_open sets FMODE_CAN_ODIRECT so the VFS allows O_DIRECT
> > opens, and splice_write is added to the file operations.
>
> Ignore my question about FMODE_CAN_ODIRECT in the previous patch, then.
Noted.
> > +
> > + if (ret >= 0 && iov_iter_count(from)) {
> > + loff_t pos;
> > + loff_t endbyte;
> > + ssize_t status;
> > +
> > + iocb->ki_flags &= ~IOCB_DIRECT;
>
> Why not set IOC_DSYNC here and let generic_write_sync do all the
> flushing work for you? There's no requirement to dump the pagecache
> after a downgraded direct write, but if you want that, use
> IOCB_DONTCACHE.
>
> --D
*nod* I will also try this when I'm updating the minix patches.
Thank you again for your comments,
-j
next prev parent reply other threads:[~2026-07-01 18:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-28 5:15 [PATCH v2 0/4] minix: convert to iomap and add direct I/O Jeremy Bingham
2026-06-28 5:15 ` [PATCH v2 1/4] minix: add iomap infrastructure Jeremy Bingham
2026-07-01 18:06 ` Darrick J. Wong
2026-07-01 18:32 ` Jeremy Bingham
2026-06-28 5:15 ` [PATCH v2 2/4] minix: convert address space operations to iomap Jeremy Bingham
2026-07-01 18:14 ` Darrick J. Wong
2026-07-01 18:37 ` Jeremy Bingham
2026-07-01 18:47 ` Darrick J. Wong
2026-06-28 5:15 ` [PATCH v2 3/4] minix: convert file operations to iomap and add Jeremy Bingham
2026-07-01 18:21 ` Darrick J. Wong
2026-07-01 18:42 ` Jeremy Bingham [this message]
2026-06-28 5:15 ` [PATCH v2 4/4] minix: fix symlink and truncate for iomap Jeremy Bingham
2026-06-29 5:27 ` [syzbot ci] Re: minix: convert to iomap and add direct I/O syzbot ci
2026-06-30 3:05 ` Jeremy Bingham
2026-06-30 4:05 ` syzbot ci
2026-07-01 18:00 ` [PATCH v2 0/4] " Darrick J. Wong
2026-07-02 18:42 ` Jeremy Bingham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMyBmMAFSXFcSt_KQNeVvfXRCbZ0twS60J5VLCVDsUfMHqce5g@mail.gmail.com \
--to=jbingham@gmail.com \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=jkoolstra@xs4all.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®