mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <slava@dubeyko.com>
To: Christian Brauner <brauner@kernel.org>,
	glaubitz@physik.fu-berlin.de,  frank.li@vivo.com, hch@lst.de
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 vdubeyko@coreweave.com, linux-xfs@vger.kernel.org,
	"Darrick J. Wong" <djwong@kernel.org>
Subject: Re: [PATCH v5 1/5] iomap: add iomap_dio_end_io() helper
Date: Mon, 23 Nov 2026 14:27:35 -0800	[thread overview]
Message-ID: <db433a237a5ce3c093494c00fe2d8e9841928581.camel@dubeyko.com> (raw)
In-Reply-To: <20261120-flach-befanden-notaufnahme-b0a663466be3@brauner>

On Fri, 2026-11-20 at 14:48 +0100, Christian Brauner wrote:
> On Tue, Nov 17, 2026 at 04:48:40PM -0800, Viacheslav Dubeyko wrote:
> > The helper updates i_size without any locking, so it can be used
> > only
> > by file systems that issue all direct writes extending i_size
> > synchronously (IOMAP_DIO_FORCE_WAIT) under inode_lock.
> 
> Meh, this should really not be named so it looks like its the default
> completion handler. iomap_dio_end_io() really sounds like it.
> 
> Name it after what it does. Plus, check the rule. With
> IOMAP_DIO_FORCE_WAIT the completion runs in the context that still
> holds
> the inode lock, so the branch that updates i_size can assert that:
> 
> 	if (size && i_size_read(inode) < iocb->ki_pos + size) {
> 		lockdep_assert_held_write(&inode->i_rwsem);
> 		i_size_write(inode, iocb->ki_pos + size);
> 		mark_inode_dirty(inode);
> 	}
> 

Makes sense. Thanks for suggestion.

> > +static inline
> > +int iomap_dio_end_io(struct kiocb *iocb, ssize_t size,
> 
> This is an ->end_io callback so its address ends up in struct
> iomap_dio_ops. Please make it a regular exported function in
> fs/iomap/direct-io.c instead of a static inline in the header.
> 

Sounds good.

> > Several file systems implement an almost identical ->end_io
> > callback
> > for direct writes: if the write succeeded and went beyond the
> > current
> > end-of-file, update i_size and mark the inode dirty (for example,
> > ext2_dio_write_end_io()). Add a generic iomap_dio_end_io() helper
> > for
> > this case, so that file systems don't need to open-code it.
> 
> Hopefully that gets a follow-up patch right away and converts ext2.

I'll do my best. :)

Thanks,
Slava.

  parent reply	other threads:[~2026-11-23 22:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  0:48 [PATCH v5 0/5] hfsplus: convert regular file I/O to iomap Viacheslav Dubeyko
2026-11-18  0:48 ` [PATCH v5 1/5] iomap: add iomap_dio_end_io() helper Viacheslav Dubeyko
2026-11-20 13:48   ` Christian Brauner
2026-11-20 18:21     ` Christoph Hellwig
2026-11-23 22:25       ` Viacheslav Dubeyko
2026-11-23 22:27     ` Viacheslav Dubeyko [this message]
2026-11-18  0:48 ` [PATCH v5 2/5] hfsplus: move file related operations to file.c Viacheslav Dubeyko
2026-11-20 18:22   ` Christoph Hellwig
2026-11-23 22:29     ` Viacheslav Dubeyko
2026-11-18  0:48 ` [PATCH v5 3/5] hfsplus: rework hfsplus_get_block() logic Viacheslav Dubeyko
2026-11-20 18:23   ` Christoph Hellwig
2026-11-18  0:48 ` [PATCH v5 4/5] hfsplus: return -EIO from hfsplus_map_extent() if no extent covers the block Viacheslav Dubeyko
2026-11-20 18:23   ` Christoph Hellwig
2026-11-18  0:48 ` [PATCH v5 5/5] hfsplus: convert regular file I/O to iomap Viacheslav Dubeyko
2026-11-20 18:26   ` Christoph Hellwig

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=db433a237a5ce3c093494c00fe2d8e9841928581.camel@dubeyko.com \
    --to=slava@dubeyko.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=vdubeyko@coreweave.com \
    /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®