From: Nathan Chancellor <nathan@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com,
Trond Myklebust <trondmy@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Steve French <sfrench@samba.org>,
Dominique Martinet <asmadeus@codewreck.org>,
Jeff Layton <jlayton@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Omar Sandoval <osandov@osandov.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org,
linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH 51/64] cachefiles: Implement the I/O routines
Date: Tue, 30 Nov 2021 09:15:06 -0700 [thread overview]
Message-ID: <YaZOCk9zxApPattb@archlinux-ax161> (raw)
In-Reply-To: <163819647945.215744.17827962047487125939.stgit@warthog.procyon.org.uk>
On Mon, Nov 29, 2021 at 02:34:39PM +0000, David Howells wrote:
> Implement the I/O routines for cachefiles. There are two sets of routines
> here: preparation and actual I/O.
>
> Preparation for read involves looking to see whether there is data present,
> and how much. Netfslib tells us what it wants us to do and we have the
> option of adjusting shrinking and telling it whether to read from the
> cache, download from the server or simply clear a region.
>
> Preparation for write involves checking for space and defending against
> possibly running short of space, if necessary punching out a hole in the
> file so that we don't leave old data in the cache if we update the
> coherency information.
>
> Then there's a read routine and a write routine. They wait for the cookie
> state to move to something appropriate and then start a potentially
> asynchronous direct I/O operation upon it.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: linux-cachefs@redhat.com
This patch as commit 0443b01eccbb ("cachefiles: Implement the I/O
routines") in -next causes the following clang warning/error:
fs/cachefiles/io.c:489:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (pos == 0)
^~~~~~~~
fs/cachefiles/io.c:492:6: note: uninitialized use occurs here
if (ret < 0) {
^~~
fs/cachefiles/io.c:489:2: note: remove the 'if' if its condition is always true
if (pos == 0)
^~~~~~~~~~~~~
fs/cachefiles/io.c:440:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 error generated.
It is the same one that has been reported two other times over the past
two months:
https://lore.kernel.org/r/202110150048.HPNa2Mn7-lkp@intel.com/
https://lore.kernel.org/r/202111070451.bsfAyznx-lkp@intel.com/
Should ret just be initialized to zero or does it need to be set to
something else if pos is not equal to zero at the end?
Cheers,
Nathan
next parent reply other threads:[~2021-11-30 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <163819575444.215744.318477214576928110.stgit@warthog.procyon.org.uk>
[not found] ` <163819647945.215744.17827962047487125939.stgit@warthog.procyon.org.uk>
2021-11-30 16:15 ` Nathan Chancellor [this message]
2021-11-30 21:05 ` [PATCH 51/64] cachefiles: Implement the I/O routines 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=YaZOCk9zxApPattb@archlinux-ax161 \
--to=nathan@kernel.org \
--cc=anna.schumaker@netapp.com \
--cc=asmadeus@codewreck.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=osandov@osandov.com \
--cc=sfrench@samba.org \
--cc=torvalds@linux-foundation.org \
--cc=trondmy@hammerspace.com \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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