From: David Howells <dhowells@redhat.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: dhowells@redhat.com, Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Jeff Layton <jlayton@kernel.org>,
linux-cachefs@redhat.com, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling
Date: Tue, 07 Dec 2021 17:02:20 +0000 [thread overview]
Message-ID: <1878025.1638896540@warthog.procyon.org.uk> (raw)
In-Reply-To: <20211204220350.633811-1-arnd@kernel.org>
Arnd Bergmann <arnd@kernel.org> wrote:
> pos = cachefiles_inject_remove_error();
> - if (pos == 0)
> - ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> - *_start, *_len);
> + if (pos != 0)
> + return 0;
> +
> + ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> + *_start, *_len);
> if (ret < 0) {
The right fix is to use "ret" rather than "pos". I've fixed this already on
my fscache-rewrite branch. Hopefully I'll be able to push that over to my
next branch shortly.
David
prev parent reply other threads:[~2021-12-07 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 22:03 [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling Arnd Bergmann
2021-12-07 17:02 ` David Howells [this message]
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=1878025.1638896540@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.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