From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753036AbdLKNuZ (ORCPT ); Mon, 11 Dec 2017 08:50:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51870 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752922AbdLKNuY (ORCPT ); Mon, 11 Dec 2017 08:50:24 -0500 Date: Mon, 11 Dec 2017 08:50:16 -0500 From: Mike Snitzer To: Arnd Bergmann Cc: Alasdair Kergon , dm-devel@redhat.com, Jens Axboe , Hannes Reinecke , Bart Van Assche , NeilBrown , Mikulas Patocka , Dan Williams , Damien Le Moal , linux-kernel@vger.kernel.org Subject: Re: dm: fix uninitialized variable reference Message-ID: <20171211135015.GA22786@redhat.com> References: <20171211113358.3599287-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171211113358.3599287-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 11 Dec 2017 13:50:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 11 2017 at 6:33am -0500, Arnd Bergmann wrote: > The last bugfix apparently introduced another problem, as shown > by this gcc warning: > > drivers/md/dm.c: In function '__send_changing_extent_only': > drivers/md/dm.c:1365:28: error: 'ti' is used uninitialized in this function [-Werror=uninitialized] > > This restores the intialization of the 'ti' variable. > > Fixes: aecefd4919de ("dm: fix __send_changing_extent_only() to send first bio and chain remainder") > Signed-off-by: Arnd Bergmann > --- > I did not test this or give the patch much thought, this just seemed > to be the most likely fix I could come up with in a short time, so > please review carefully, and ignore if the solution is something > else. > --- > drivers/md/dm.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 05aa9c094352..f19e9787076e 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1356,6 +1356,10 @@ static int __send_changing_extent_only(struct clone_info *ci, > unsigned len; > unsigned num_bios; > > + ti = dm_table_find_target(ci->map, ci->sector); > + if (!dm_target_is_valid(ti)) > + return -EIO; > + > /* > * Even though the device advertised support for this type of > * request, that does not mean every target supports it, and > -- > 2.9.0 > Already resolved this thanks to Stephen Rothwell's earlier (substantially more discrete) mail. I always enjoy a good public shaming but this cc list is particularly wide. Why? Anyway, I resolved this differently: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.16&id=496cc64f4d10ba112aa0679a3bf29ae6ea74ff3d