linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: [PATCH v2 0/2] filemap: skip write and wait if end offset precedes start
Date: Mon, 28 Nov 2022 10:56:30 -0500	[thread overview]
Message-ID: <20221128155632.3950447-1-bfoster@redhat.com> (raw)

Hi all,

Here's a v2 of a prospective fix for the odd write and wait behavior
described in the patch 1 commit log. Technically patch 1 could simply
remove the check rather than lift it into the callers, but this seemed a
bit more user friendly to me. Patch 2 is appended after observation that
fadvise() interacted poorly with the v1 patch. This is no longer a
problem with v2, making patch 2 purely a cleanup.

This series survived both fstests and ltp regression runs without
observable problems. I had (end < start) warning checks in each relevant
function, with fadvise() being the only caller that triggered them. That
said, I dropped the warnings after testing because there seemed to much
potential for noise from the various other callers.

Brian

v2:
- Remove check from fdatawait rather than add to fdatawrite (as in v1).
  Lift into file[map]_write_and_wait_range() helpers.
- Added patch 2.
v1: https://lore.kernel.org/linux-mm/20221028125428.976549-1-bfoster@redhat.com/

Brian Foster (2):
  filemap: skip write and wait if end offset precedes start
  mm/fadvise: use LLONG_MAX instead of -1 for eof

 mm/fadvise.c | 2 +-
 mm/filemap.c | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.37.3



             reply	other threads:[~2022-11-28 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 15:56 Brian Foster [this message]
2022-11-28 15:56 ` [PATCH v2 1/2] " Brian Foster
2022-11-30  7:44   ` Christoph Hellwig
2022-11-28 15:56 ` [PATCH v2 2/2] mm/fadvise: use LLONG_MAX instead of -1 for eof Brian Foster
2022-11-30  7:46   ` 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=20221128155632.3950447-1-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-mm@kvack.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