[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1878025.1638896540@warthog.procyon.org.uk>
Date: Tue, 07 Dec 2021 17:02:20 +0000
From: David Howells <dhowells@...hat.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: dhowells@...hat.com, Arnd Bergmann <arnd@...db.de>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Jeff Layton <jlayton@...nel.org>, linux-cachefs@...hat.com,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling
Arnd Bergmann <arnd@...nel.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
Powered by blists - more mailing lists