Linux-NVDIMM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nvdimm/btt: fix variable 'rc' set but not used
@ 2019-10-30 19:15 Qian Cai
  2019-10-30 20:25 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-10-30 19:15 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-nvdimm, linux-kernel, Qian Cai

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@lca.pw>
---
 drivers/nvdimm/btt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 3e9f45aec8d1..59852f7e2d60 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1266,6 +1266,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip,
 			/* Media error - set the e_flag */
 			rc = btt_map_write(arena, premap, postmap, 0, 1,
 				NVDIMM_IO_ATOMIC);
+
+			if (rc)
+				dev_warn_ratelimited(to_dev(arena),
+					"Error persistently tracking bad blocks\n");
+
 			goto out_rtt;
 		}
 
-- 
1.8.3.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nvdimm/btt: fix variable 'rc' set but not used
  2019-10-30 19:15 [PATCH] nvdimm/btt: fix variable 'rc' set but not used Qian Cai
@ 2019-10-30 20:25 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2019-10-30 20:25 UTC (permalink / raw)
  To: Qian Cai; +Cc: linux-nvdimm, Linux Kernel Mailing List

On Wed, Oct 30, 2019 at 12:16 PM Qian Cai <cai@lca.pw> 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@lca.pw>
> ---
>  drivers/nvdimm/btt.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 3e9f45aec8d1..59852f7e2d60 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -1266,6 +1266,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip,
>                         /* Media error - set the e_flag */
>                         rc = btt_map_write(arena, premap, postmap, 0, 1,
>                                 NVDIMM_IO_ATOMIC);
> +
> +                       if (rc)
> +                               dev_warn_ratelimited(to_dev(arena),
> +                                       "Error persistently tracking bad blocks\n");

If the driver is going to warn about bad blocks it should at least
include the block address that is returning an error.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 19:15 [PATCH] nvdimm/btt: fix variable 'rc' set but not used Qian Cai
2019-10-30 20:25 ` Dan Williams

Linux-NVDIMM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvdimm/0 linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ https://lore.kernel.org/linux-nvdimm \
		linux-nvdimm@lists.01.org
	public-inbox-index linux-nvdimm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.01.lists.linux-nvdimm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git