All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Alasdair Kergon" <agk@redhat.com>,
	"Mike Snitzer" <snitzer@redhat.com>,
	dm-devel@redhat.com, "Neil Brown" <neilb@suse.de>,
	linux-raid@vger.kernel.org, "Jörn Engel" <joern@purestorage.com>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] dm space map metadata: fix sm_bootstrap_get_nr_blocks()
Date: Mon, 1 Dec 2014 13:56:12 +0000	[thread overview]
Message-ID: <20141201135611.GA3151@debian> (raw)
In-Reply-To: <20141129125021.GD27251@mwanda>

Ack, thanks.

On Sat, Nov 29, 2014 at 03:50:21PM +0300, Dan Carpenter wrote:
> This function isn't right and it causes a static checker warning:
> 
> 	drivers/md/dm-thin.c:3016 maybe_resize_data_dev()
> 	error: potentially using uninitialized 'sb_data_size'.
> 
> It should set "*count" and return zero on success the same as the
> sm_metadata_get_nr_blocks() function does earlier.
> 
> Fixes: 3241b1d3e0aa ('dm: add persistent data library')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Not tested.
> 
> diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
> index 786b689..f4e22bc 100644
> --- a/drivers/md/persistent-data/dm-space-map-metadata.c
> +++ b/drivers/md/persistent-data/dm-space-map-metadata.c
> @@ -564,7 +564,9 @@ static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count
>  {
>  	struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
>  
> -	return smm->ll.nr_blocks;
> +	*count = smm->ll.nr_blocks;
> +
> +	return 0;
>  }
>  
>  static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count)

WARNING: multiple messages have this Message-ID (diff)
From: Joe Thornber <thornber@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Alasdair Kergon" <agk@redhat.com>,
	"Mike Snitzer" <snitzer@redhat.com>,
	dm-devel@redhat.com, "Neil Brown" <neilb@suse.de>,
	linux-raid@vger.kernel.org, "Jörn Engel" <joern@purestorage.com>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] dm space map metadata: fix sm_bootstrap_get_nr_blocks()
Date: Mon, 01 Dec 2014 13:56:12 +0000	[thread overview]
Message-ID: <20141201135611.GA3151@debian> (raw)
In-Reply-To: <20141129125021.GD27251@mwanda>

Ack, thanks.

On Sat, Nov 29, 2014 at 03:50:21PM +0300, Dan Carpenter wrote:
> This function isn't right and it causes a static checker warning:
> 
> 	drivers/md/dm-thin.c:3016 maybe_resize_data_dev()
> 	error: potentially using uninitialized 'sb_data_size'.
> 
> It should set "*count" and return zero on success the same as the
> sm_metadata_get_nr_blocks() function does earlier.
> 
> Fixes: 3241b1d3e0aa ('dm: add persistent data library')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Not tested.
> 
> diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
> index 786b689..f4e22bc 100644
> --- a/drivers/md/persistent-data/dm-space-map-metadata.c
> +++ b/drivers/md/persistent-data/dm-space-map-metadata.c
> @@ -564,7 +564,9 @@ static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count
>  {
>  	struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
>  
> -	return smm->ll.nr_blocks;
> +	*count = smm->ll.nr_blocks;
> +
> +	return 0;
>  }
>  
>  static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count)

  reply	other threads:[~2014-12-01 13:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 12:50 [patch] dm space map metadata: fix sm_bootstrap_get_nr_blocks() Dan Carpenter
2014-11-29 12:50 ` Dan Carpenter
2014-12-01 13:56 ` Joe Thornber [this message]
2014-12-01 13:56   ` Joe Thornber

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=20141201135611.GA3151@debian \
    --to=thornber@redhat.com \
    --cc=agk@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dm-devel@redhat.com \
    --cc=joern@purestorage.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=snitzer@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.