All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	"Darrick J . Wong" <djwong@kernel.org>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	Disha Goel <disgoel@linux.ibm.com>
Subject: Re: [RFCv3 02/10] libfs: Add __generic_file_fsync_nolock implementation
Date: Mon, 17 Apr 2023 15:31:53 +0530	[thread overview]
Message-ID: <87r0sij08e.fsf@doe.com> (raw)
In-Reply-To: <20230417073255.kzauk5qwu5bjcsmh@quack3>

Jan Kara <jack@suse.cz> writes:

> On Fri 14-04-23 19:59:42, Ritesh Harjani wrote:
>> Jan Kara <jack@suse.cz> writes:
>>
>> > On Fri 14-04-23 06:12:00, Christoph Hellwig wrote:
>> >> On Fri, Apr 14, 2023 at 02:51:48PM +0200, Jan Kara wrote:
>> >> > On Thu 13-04-23 22:59:24, Christoph Hellwig wrote:
>> >> > > Still no fan of the naming and placement here.  This is specific
>> >> > > to the fs/buffer.c infrastructure.
>> >> >
>> >> > I'm fine with moving generic_file_fsync() & friends to fs/buffer.c and
>> >> > creating the new function there if it makes you happier. But I think
>> >> > function names should be consistent (hence the new function would be named
>> >> > __generic_file_fsync_nolock()). I agree the name is not ideal and would use
>> >> > cleanup (along with transitioning everybody to not take i_rwsem) but I
>> >> > don't want to complicate this series by touching 13+ callsites of
>> >> > generic_file_fsync() and __generic_file_fsync(). That's for a separate
>> >> > series.
>> >>
>> >> I would not change the existing function.  Just do the right thing for
>> >> the new helper and slowly migrate over without complicating this series.
>> >
>> > OK, I can live with that temporary naming inconsistency I guess. So
>> > the function will be __buffer_file_fsync()?
>>
>> This name was suggested before, so if that's ok I will go with this -
>> "generic_buffer_fsync()". It's definition will lie in fs/buffer.c and
>> it's declaration in include/linux/buffer_head.h
>>
>> Is that ok?
>
> Yes, that is fine by me. And I suppose this variant will also issue the
> cache flush, won't it?

No. We don't issue cache flush (REQ_PREFLUSH) in generic_buffer_fsync(),
neither __generic_file_fsync() does that.

> But then we also need __generic_buffer_fsync()
> without issuing the cache flush for ext4 (we need to sync parent before
> issuing a cache flush) and FAT.

Yes, we do take care of that by -

<simplified logic>
ret = generic_buffer_fsync()
if (!ret)
   ret = ext4_sync_parent(inode)
if (test_opt(inode->i_sb, BARRIER))
   blkdev_issue_flush()

Am I missing anything. I have sent a [v5] with all of the comments
addressed. Could you please take a look and let me know if it looks
good or is there anything required?

[v5]: https://lore.kernel.org/linux-ext4/cover.1681639164.git.ritesh.list@gmail.com/T/#t

-ritesh

  reply	other threads:[~2023-04-17 10:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  8:40 [RFCv3 00/10] ext2: DIO to use iomap Ritesh Harjani (IBM)
2023-04-13  8:40 ` [RFCv3 01/10] ext2/dax: Fix ext2_setsize when len is page aligned Ritesh Harjani (IBM)
2023-04-13  8:40 ` [RFCv3 02/10] libfs: Add __generic_file_fsync_nolock implementation Ritesh Harjani (IBM)
2023-04-14  5:59   ` Christoph Hellwig
2023-04-14 12:51     ` Jan Kara
2023-04-14 13:12       ` Christoph Hellwig
2023-04-14 14:20         ` Jan Kara
2023-04-14 14:29           ` Ritesh Harjani
2023-04-17  7:32             ` Jan Kara
2023-04-17 10:01               ` Ritesh Harjani [this message]
2023-04-13  8:40 ` [RFCv3 03/10] ext4: Use " Ritesh Harjani (IBM)
2023-04-13  8:40 ` [RFCv3 04/10] ext2: " Ritesh Harjani (IBM)
2023-04-13  8:40 ` [RFCv3 05/10] ext2: Move direct-io to use iomap Ritesh Harjani (IBM)
2023-04-13  8:40 ` [RFCv3 06/10] fs.h: Add TRACE_IOCB_STRINGS for use in trace points Ritesh Harjani (IBM)
2023-04-13  9:54   ` Christian Brauner
2023-04-13 10:15     ` Ritesh Harjani
2023-04-13  8:40 ` [RFCv3 07/10] ext2: Add direct-io " Ritesh Harjani (IBM)
2023-04-14  6:00   ` Christoph Hellwig
2023-04-14  8:06     ` Ritesh Harjani
2023-04-13  8:40 ` [RFCv3 08/10] iomap: Remove IOMAP_DIO_NOSYNC unused dio flag Ritesh Harjani (IBM)
2023-04-13 14:34   ` Darrick J. Wong
2023-04-13  8:40 ` [RFCv3 09/10] iomap: Minor refactor of iomap_dio_rw Ritesh Harjani (IBM)
2023-04-13 14:35   ` Darrick J. Wong
2023-04-14  6:00     ` Christoph Hellwig
2023-04-13  8:40 ` [RFCv3 10/10] iomap: Add trace points for DIO path Ritesh Harjani (IBM)
2023-04-13 14:42   ` Darrick J. Wong
2023-04-13 20:18     ` Ritesh Harjani
2023-04-14  2:16       ` Darrick J. Wong
2023-04-14  5:21         ` Ritesh Harjani
2023-04-14  6:04   ` Christoph Hellwig
2023-04-14  7:56     ` Ritesh Harjani
2023-04-14 13:06       ` Christoph Hellwig
2023-04-14 14:38         ` Ritesh Harjani

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=87r0sij08e.fsf@doe.com \
    --to=ritesh.list@gmail.com \
    --cc=disgoel@linux.ibm.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.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 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.