From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8956A2C82 for ; Tue, 30 Nov 2021 21:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638306374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ovfGlfFYOBiNEdFFUCvznobAjXbygpnoFNwMXB/Sg+Q=; b=gL1hRIny9EXIuYdIgF5Wfl6faB2xJLAUQBYcxzwveKWAQ6ngqAJtbjFO7TEfpBAJ1C012k hRKRPlCfGoqsCHo4HhI7eCDDZXjFhoYtJ00qNl4hYVebt+s1fesM0kFCfGyUerWoyBPHf/ oSObpZ8v9dvWQbgJHNm5BU7oG760tt4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-503-ojpTxzvvOhGXgffSsKK03g-1; Tue, 30 Nov 2021 16:06:08 -0500 X-MC-Unique: ojpTxzvvOhGXgffSsKK03g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 712C91853026; Tue, 30 Nov 2021 21:06:05 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id BABF910013D7; Tue, 30 Nov 2021 21:05:49 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <163819575444.215744.318477214576928110.stgit@warthog.procyon.org.uk> <163819647945.215744.17827962047487125939.stgit@warthog.procyon.org.uk> To: Nathan Chancellor Cc: dhowells@redhat.com, linux-cachefs@redhat.com, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , Matthew Wilcox , Alexander Viro , Omar Sandoval , Linus Torvalds , 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 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <503521.1638306348.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Nov 2021 21:05:48 +0000 Message-ID: <503522.1638306348@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Nathan Chancellor wrote: > 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 wh= enever 'if' condition is false [-Werror,-Wsometimes-uninitialized] > if (pos =3D=3D 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 alwa= ys true > if (pos =3D=3D 0) > ^~~~~~~~~~~~~ > fs/cachefiles/io.c:440:9: note: initialize the variable 'ret' to silence= this warning > int ret; > ^ > =3D 0 > 1 error generated. pos =3D cachefiles_inject_remove_error(); if (pos =3D=3D 0) ret =3D vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, That should be: ret =3D cachefiles_inject_remove_error(); if (ret =3D=3D 0) ret =3D vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, David