linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/3] btrfs: don't fallback to buffered IO for NOWAIT direct IO writes
Date: Mon, 4 Jul 2022 05:00:14 -0700	[thread overview]
Message-ID: <YsLWTuUF0nq+sFKw@infradead.org> (raw)
In-Reply-To: <1a7080444b73f8ca1481a7786e52bdf405193be9.1656934419.git.fdmanana@suse.com>

>  buffered:
> +	/*
> +	 * If we are in a NOWAIT context, then return -EAGAIN to signal the caller
> +	 * it must retry the operation in a context where blocking is acceptable,
> +	 * since we currently don't have NOWAIT semantics support for buffered IO

.. more overly long comments here.

> +	 * and may block there for many reasons (reserving space for example).
> +	 */
> +	if (iocb->ki_flags & IOCB_NOWAIT) {
> +		err = -EAGAIN;
> +		goto out;
> +	}

but more importantly, shouldn't this be above the buffered label? The
only places that jumps to it is the alignment check, and if the
alignment is incorrect now, it won't get any better in a workqueue
context.

  reply	other threads:[~2022-07-04 12:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 11:42 [PATCH 0/3] btrfs: a few direct IO fixes/improvements fdmanana
2022-07-04 11:42 ` [PATCH 1/3] btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents fdmanana
2022-07-04 11:57   ` Christoph Hellwig
2022-07-07 16:47     ` David Sterba
2022-07-04 11:42 ` [PATCH 2/3] btrfs: don't fallback to buffered IO for NOWAIT direct IO writes fdmanana
2022-07-04 12:00   ` Christoph Hellwig [this message]
2022-07-04 12:11     ` Filipe Manana
2022-07-04 12:12       ` Christoph Hellwig
2022-07-04 12:19         ` Filipe Manana
2022-07-04 12:37           ` Christoph Hellwig
2022-07-04 11:42 ` [PATCH 3/3] btrfs: fault in pages for dio reads/writes in a more controlled way fdmanana
2022-07-08 15:20 ` [PATCH 0/3] btrfs: a few direct IO fixes/improvements David Sterba

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=YsLWTuUF0nq+sFKw@infradead.org \
    --to=hch@infradead.org \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).