linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: David Howells <dhowells@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Jens Axboe <axboe@kernel.dk>, Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] cachefiles: move kiocb_start_write() after error injection
Date: Mon, 20 Nov 2023 11:56:46 -0500	[thread overview]
Message-ID: <20231120165646.GA1606827@perftesting> (raw)
In-Reply-To: <20231120101424.2201480-1-amir73il@gmail.com>

On Mon, Nov 20, 2023 at 12:14:24PM +0200, Amir Goldstein wrote:
> We want to move kiocb_start_write() into vfs_iocb_iter_write(), but
> first we need to move it passed cachefiles_inject_write_error() and
> prevent calling kiocb_end_write() if error was injected.
> 
> We set the IOCB_WRITE flag after cachefiles_inject_write_error()
> and use it as indication that kiocb_start_write() was called in the
> cleanup/completion handler.
> 
> Link: https://lore.kernel.org/r/CAOQ4uxihfJJRxxUhAmOwtD97Lg8PL8RgXw88rH1UfEeP8AtP+w@mail.gmail.com/
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

Sorry Amir I meant to respond on Saturday but I got busy with other things.

I was thinking instead, for your series, you could do something like

ret = cachefiles_inject_write_error();
if (ret) {
	/* Start kiocb so the error handling is done below. */
	kiocb_start_write(&ki->iocb);
} else {
	ret = vfs_iocb_iter_write(file, &ki->iocb, iter);
}

which seems a bit cleaner than messing with the flags everywhere.  Thanks,

Josef

  reply	other threads:[~2023-11-20 16:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 10:14 [PATCH] cachefiles: move kiocb_start_write() after error injection Amir Goldstein
2023-11-20 16:56 ` Josef Bacik [this message]
2023-11-20 17:05   ` Amir Goldstein
2023-11-21  9:28     ` Amir Goldstein
2023-11-20 20:19   ` David Howells

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=20231120165646.GA1606827@perftesting \
    --to=josef@toxicpanda.com \
    --cc=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /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).