Linux filesystem development
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Steve French <smfrench@gmail.com>
Cc: David Howells <dhowells@redhat.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	ronnie sahlberg <ronniesahlberg@gmail.com>,
	"R. Diez" <rdiez-2006@rd10.de>
Subject: Re: [PATCH] fix netfs/folios regression
Date: Tue, 6 Feb 2024 23:18:51 +0000	[thread overview]
Message-ID: <ZcK-W54WoNQswKfg@casper.infradead.org> (raw)
In-Reply-To: <CAH2r5msJQGww+MAJLpA9qNw_jDt9ymiHO+bcpTkGMJpJdVc=gA@mail.gmail.com>

On Tue, Feb 06, 2024 at 05:14:42PM -0600, Steve French wrote:
> The code in question is a little hard to follow, and may eventually
> get rewritten by later folio/netfs patches from David Howells but the
> problem is in
> cifs_write_back_from_locked_folio() and cifs_writepages_region() where
> after the write (of maximum write size) completes, the next write
> skips to the beginning of the next page (leaving the tail end of the
> previous page unwritten).  This is not an issue with typical servers
> and typical wsize values because those will almost always be a
> multiple of 4096, but in the bug report the server in question was old
> and had sent a value for maximum write size that was not a multiple of
> 4096.
> 
> This can be a temporary fix, that can be removed as netfs/folios
> implementation improves here - but in the short term the easiest way
> to fix this seems to be to round the negotiated maximum_write_size
> down if not a multiple of 4096, to be a multiple of 4096 (this can be
> removed in the future when the folios code is found which caused
> this), and also warn the user if they pick a wsize that is not
> recommended, not a multiple of 4096.

Seems like a sensible stopgap, but probably the patch should use
PAGE_SIZE rather than plain 4096 (what about
Alpha/Sparc/powerpc-64k/arm64-{16,64}k?)

Also, what if the server says its max-write-size is 2048 bytes?
Also, does the code work well if the max-write-size is, say, 20480
bytes?  (ie an odd multiple of PAGE_SIZE is fine; it doesn't need to be
a power-of-two?)


  reply	other threads:[~2024-02-06 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 23:14 [PATCH] fix netfs/folios regression Steve French
2024-02-06 23:18 ` Matthew Wilcox [this message]
2024-02-07  1:38   ` Steve French

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=ZcK-W54WoNQswKfg@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rdiez-2006@rd10.de \
    --cc=ronniesahlberg@gmail.com \
    --cc=smfrench@gmail.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