Linux-api Archive mirror
 help / color / mirror / Atom feed
From: Jeremy Bongio <bongiojp@gmail.com>
To: Ted Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-block@vger.kernel.org,
	Jeremy Bongio <jbongio@google.com>
Subject: [RFC PATCH 0/1] Change failover behavior for DIRECT writes in ext4/block fops
Date: Wed,  1 May 2024 16:15:32 -0700	[thread overview]
Message-ID: <20240501231533.3128797-1-bongiojp@gmail.com> (raw)

From: Jeremy Bongio <jbongio@google.com>

In kernel 6.9, for an O_DIRECT write:
xfs - Will fallback to a sync, buffered write for -ENOTBLK (for reflink CoW)
ext2/3/4 - will fallback to a sync, buffered write for short writes.
       If iomap returns -ENOTBLK, write will return status of 0.
block fops - will fallback to a sync, buffered write for short writes.
zonefs - Will fallback to a sync, buffered write for -ENOTBLK.
         Will return the bytes written for a short write, no fallback.

Relevant commit:
60263d5889e6d "iomap: fall back to buffered writes for invalidation failures"

In most cases, I think users would be surprised if an O_DIRECT write request
silently resulted in a buffered request.

The iomap_dio_rw() return code -ENOTBLK means page invalidation failed before
submitting the bio.

Is falling back to buffered IO for short writes or -ENOTBLK desirable in ext4
or block fops?

Jeremy Bongio (1):
  Remove buffered failover for ext4 and block fops direct writes.

 block/fops.c   |  3 ---
 fs/ext4/file.c | 27 ---------------------------
 2 files changed, 30 deletions(-)

-- 
2.44.0.769.g3c40516874-goog


             reply	other threads:[~2024-05-01 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01 23:15 Jeremy Bongio [this message]
2024-05-01 23:15 ` [RFC PATCH 1/1] Remove buffered failover for ext4 and block fops direct writes Jeremy Bongio
2024-05-02  5:45   ` Christoph Hellwig
2024-05-02 14:01     ` Theodore Ts'o
2024-05-02 14:33       ` Darrick J. Wong

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=20240501231533.3128797-1-bongiojp@gmail.com \
    --to=bongiojp@gmail.com \
    --cc=jbongio@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).