lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ab127750fc543ec236dc241255c70dd30abc6f21.camel@intel.com>
Date:   Thu, 31 Oct 2019 17:17:18 +0000
From:   "Verma, Vishal L" <vishal.l.verma@...el.com>
To:     "cai@....pw" <cai@....pw>,
        "Williams, Dan J" <dan.j.williams@...el.com>
CC:     "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Jiang, Dave" <dave.jiang@...el.com>,
        "Busch, Keith" <keith.busch@...el.com>,
        "Weiny, Ira" <ira.weiny@...el.com>
Subject: Re: [PATCH v3] nvdimm/btt: fix variable 'rc' set but not used

On Thu, 2019-10-31 at 10:05 -0400, Qian Cai wrote:
> drivers/nvdimm/btt.c: In function 'btt_read_pg':
> drivers/nvdimm/btt.c:1264:8: warning: variable 'rc' set but not used
> [-Wunused-but-set-variable]
>     int rc;
>         ^~
> 
> Add a ratelimited message in case a storm of errors is encountered.
> 
> Fixes: d9b83c756953 ("libnvdimm, btt: rework error clearing")
> Signed-off-by: Qian Cai <cai@....pw>
> ---
> v3: remove the unused "rc" per Vishal.
> v2: include the block address that is returning an error per Dan.
> 
>  drivers/nvdimm/btt.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Looks good,
Reviewed-by: Vishal Verma <vishal.l.verma@...el.com>

> 
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 3e9f45aec8d1..5129543a0473 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -1261,11 +1261,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip,
>  
>  		ret = btt_data_read(arena, page, off, postmap, cur_len);
>  		if (ret) {
> -			int rc;
> -
>  			/* Media error - set the e_flag */
> -			rc = btt_map_write(arena, premap, postmap, 0, 1,
> -				NVDIMM_IO_ATOMIC);
> +			if (btt_map_write(arena, premap, postmap, 0, 1, NVDIMM_IO_ATOMIC))
> +				dev_warn_ratelimited(to_dev(arena),
> +					"Error persistently tracking bad blocks at %#x\n",
> +					premap);
>  			goto out_rtt;
>  		}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ