public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org,
	Marc Dionne <marc.dionne@auristor.com>,
	Christoph Hellwig <hch@lst.de>,
	Matthew Wilcox <willy@infradead.org>,
	Theodore Ts'o <tytso@mit.edu>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] afs: Stop implementing ->writepage()
Date: Mon, 21 Nov 2022 08:17:04 +0100	[thread overview]
Message-ID: <20221121071704.GC23882@lst.de> (raw)
In-Reply-To: <166876785552.222254.4403222906022558715.stgit@warthog.procyon.org.uk>

On Fri, Nov 18, 2022 at 10:37:35AM +0000, David Howells wrote:
> A hint flag is added to the writeback_control struct so that a filesystem
> can say that the write is triggered by write_begin seeing a conflicting
> write.  This causes do_writepages() to do a single pass of the loop only.

Not a huge fan of that, especially as write_begin is not really a
method, but just an awkward hook in legacy write implementations.

I'd much rather have a private pointer in the writeback_control and
make the behavior implementation specific.  It will need to be split
into a separate patch with proper documentation and a CC to linux-mm.

>  (1) afs_write_back_from_locked_folio() could be called directly rather
>      than calling filemap_fdatawrite_wbc(), but that would avoid the
>      control group stuff that wbc_attach_and_unlock_inode() and co. seem to
>      do.  Do I actually need to do this?

That would be much preferred over the for_write_begin hack, given that
write_begin really isn't a well defined method but a hacky hook for
legacy write implementations.

>  (2) afs_writepages_region() has a loop in it to generate multiple writes.
>      do_writepages() also acquired a loop[2] which will also generate
>      multiple writes.  Should I remove the loop from
>      afs_writepages_region() and leave it to the caller of ->writepages()?

Dropping out of ->writpages inside a page does seem a bit problematic,
so you probably want to keep the loop.


  reply	other threads:[~2022-11-21  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 10:37 [RFC PATCH] afs: Stop implementing ->writepage() David Howells
2022-11-21  7:17 ` Christoph Hellwig [this message]
2022-11-21  8:28   ` David Howells
2022-11-21  8:33     ` 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=20221121071704.GC23882@lst.de \
    --to=hch@lst.de \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.org \
    /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