All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya.Kulkarni@wdc.com (Chaitanya Kulkarni)
Subject: [PATCH 06/12] nvmet: add error log support for bdev backend
Date: Mon, 10 Dec 2018 22:52:37 +0000	[thread overview]
Message-ID: <BYAPR04MB4502982A976C380856643DD586A50@BYAPR04MB4502.namprd04.prod.outlook.com> (raw)
In-Reply-To: <63b30134-e65a-fde4-3500-708e31bc3da9@grimberg.me>







From: Sagi Grimberg <sagi@grimberg.me>
Sent: Monday, December 10, 2018 12:31 PM
To: Chaitanya Kulkarni; linux-nvme at lists.infradead.org
Cc: hch at lst.de; keith.busch at intel.com
Subject: Re: [PATCH 06/12] nvmet: add error log support for bdev backend
? 
 

> +static u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)
> +{
> +???? u16 status = NVME_SC_SUCCESS;
> +
> +???? if (likely(blk_sts == BLK_STS_OK))
> +???????????? return status;
> +???? /*
> +????? * Right now there exists M : 1 mapping between block layer error
> +????? * to the NVMe status code (see nvme_error_status()). For consistency,
> +????? * when we reverse map we use most appropriate NVMe Status code from
> +????? * the group of the NVMe staus codes used in the nvme_error_status().
> +????? */
> +???? switch (blk_sts) {
> +???? case BLK_STS_NOSPC:
> +???????????? status = NVME_SC_CAP_EXCEEDED | NVME_SC_DNR;
> +???????????? req->error_loc = offsetof(struct nvme_rw_command, length);
> +???????????? break;
> +???? case BLK_STS_TARGET:
> +???????????? status = NVME_SC_LBA_RANGE | NVME_SC_DNR;
> +???????????? req->error_loc = offsetof(struct nvme_rw_command, slba);
> +???????????? break;
> +???? case BLK_STS_NOTSUPP:
> +???????????? req->error_loc = offsetof(struct nvme_common_command, opcode);
> +???????????? switch (req->cmd->common.opcode) {
> +???????????? case nvme_cmd_dsm:
> +???????????? case nvme_cmd_write_zeroes:
> +???????????????????? status = NVME_SC_ONCS_NOT_SUPPORTED | NVME_SC_DNR;
> +???????????????????? break;
> +???????????? default:
> +???????????????????? status = NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
> +???????????? }
> +???????????? break;
> +???? case BLK_STS_MEDIUM:
> +???????????? status = NVME_SC_ACCESS_DENIED;
> +???????????? req->error_loc = offsetof(struct nvme_rw_command, nsid);
> +???????????? break;
> +???? case BLK_STS_PROTECTION:
> +???????????? status = NVME_SC_INVALID_PI;
> +???????????? req->error_loc = offsetof(struct nvme_rw_command, nsid);

Is this really the nsid (not PRINFO)? Moreover, I think we should not
propagate this if the host did not send us any PI...
[CK] Okay, I'll skip this error code.

> @@ -205,6 +268,7 @@ static void nvmet_bdev_execute_write_zeroes(struct nvmet_req *req)
>??????? u16 status = NVME_SC_SUCCESS;
>??????? sector_t sector;
>??????? sector_t nr_sector;
> +???? int ret;
>?? 
>??????? sector = le64_to_cpu(write_zeroes->slba) <<
>??????????????? (req->ns->blksize_shift - 9);
> @@ -215,6 +279,9 @@ static void nvmet_bdev_execute_write_zeroes(struct nvmet_req *req)
>??????????????????????????????? GFP_KERNEL, &bio, 0))
>??????????????? status = NVME_SC_INTERNAL | NVME_SC_DNR;
>?? 
> +???? ret = __blkdev_issue_zeroout(req->ns->bdev, sector, nr_sector,
> +???????????????????? GFP_KERNEL, &bio, 0);

Shouldn't this erase the former __blkdev_issue_zeroout?

[CK] My bad when porting the patches, will fix it in the next round.    

  reply	other threads:[~2018-12-10 22:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  5:49 [PATCH 00/12] nvmet: add error log page support Chaitanya Kulkarni
2018-12-10  5:50 ` [PATCH 01/12] nvme: remove nvme_common command cdw10 array Chaitanya Kulkarni
2018-12-10 20:09   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 02/12] nvme: add error log page slot definition Chaitanya Kulkarni
2018-12-10 20:10   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 03/12] nvmet: add error-log definitions Chaitanya Kulkarni
2018-12-10 20:12   ` Sagi Grimberg
2018-12-10 22:47     ` Chaitanya Kulkarni
2018-12-10  5:50 ` [PATCH 04/12] nvmet: add interface to update error-log page Chaitanya Kulkarni
2018-12-10 20:18   ` Sagi Grimberg
2018-12-10 22:48     ` Chaitanya Kulkarni
2018-12-10  5:50 ` [PATCH 05/12] nvmet: add error log support in the core Chaitanya Kulkarni
2018-12-10 20:22   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 06/12] nvmet: add error log support for bdev backend Chaitanya Kulkarni
2018-12-10 20:31   ` Sagi Grimberg
2018-12-10 22:52     ` Chaitanya Kulkarni [this message]
2018-12-10  5:50 ` [PATCH 07/12] nvmet: add error log support for file backend Chaitanya Kulkarni
2018-12-10 20:32   ` Sagi Grimberg
2018-12-10 22:53     ` Chaitanya Kulkarni
2018-12-10  5:50 ` [PATCH 08/12] nvmet: add error log support for fabrics-cmd Chaitanya Kulkarni
2018-12-10 20:36   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 09/12] nvmet: add error log support for rdma backend Chaitanya Kulkarni
2018-12-10 20:37   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 10/12] nvmet: add error log support for admin-cmd Chaitanya Kulkarni
2018-12-10 20:40   ` Sagi Grimberg
2018-12-10  5:50 ` [PATCH 11/12] nvmet: add error log page cmd handler Chaitanya Kulkarni
2018-12-10  5:50 ` [PATCH 12/12] nvmet: update smart log with num err log entries Chaitanya Kulkarni
     [not found] ` <BYAPR04MB4502206C5362955EF2F2014686A50@BYAPR04MB4502.namprd04.prod.outlook.com>
2018-12-11 14:15   ` [PATCH 10/12] nvmet: add error log support for admin-cmd hch
2018-12-11 23:59     ` Sagi Grimberg
2018-12-12  0:38       ` Chaitanya Kulkarni

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=BYAPR04MB4502982A976C380856643DD586A50@BYAPR04MB4502.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.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.