linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Max Gurtovoy <maxg@mellanox.com>,
	linux-block@vger.kernel.org, martin.petersen@oracle.com
Subject: Re: [PATCH 1/1] block: add default clause for unsupported T10_PI types
Date: Sat, 21 Sep 2019 16:12:20 -0600	[thread overview]
Message-ID: <6e99fefd-ff7c-e3ee-087c-ed42baa7f4f5@kernel.dk> (raw)
In-Reply-To: <1569103249-24018-1-git-send-email-maxg@mellanox.com>

On 9/21/19 4:00 PM, Max Gurtovoy wrote:
> kbuild robot reported the following warning:
> 
> block/t10-pi.c: In function 't10_pi_verify':
> block/t10-pi.c:62:3: warning: enumeration value 'T10_PI_TYPE0_PROTECTION'
>                       not handled in switch [-Wswitch]
>        switch (type) {
>        ^~~~~~

This commit message is woefully lacking. It doesn't explain anything...?
Why aren't we just flagging this as an error? Seems a lot saner than adding
a BUG().


diff --git a/block/t10-pi.c b/block/t10-pi.c
index 0c0120a672f9..6a1d4128a9d4 100644
--- a/block/t10-pi.c
+++ b/block/t10-pi.c
@@ -79,6 +79,10 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
 			    pi->ref_tag == T10_PI_REF_ESCAPE)
 				goto next;
 			break;
+		default:
+			pr_err("%s: unsupported protection type: %d\n",
+						iter->disk_name, type);
+			return BLK_STS_PROTECTION;
 		}
 
 		csum = fn(iter->data_buf, iter->interval);

-- 
Jens Axboe


  reply	other threads:[~2019-09-21 22:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-21 22:00 [PATCH 1/1] block: add default clause for unsupported T10_PI types Max Gurtovoy
2019-09-21 22:12 ` Jens Axboe [this message]
2019-09-21 22:54   ` Martin K. Petersen
2019-09-21 23:29     ` Jens Axboe
2019-09-22  9:38       ` Max Gurtovoy
2019-09-22 16:25         ` Jens Axboe
2019-09-22 17:31           ` Martin K. Petersen
2019-09-22 21:21             ` Max Gurtovoy
2019-09-23 14:05               ` Jens Axboe

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=6e99fefd-ff7c-e3ee-087c-ed42baa7f4f5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=maxg@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).