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>] [day] [month] [year] [list]
Message-ID: <ff20637e-f475-4a31-13d7-66312bc40947@micron.com>
Date:	Mon, 22 Feb 2016 21:02:23 -0800
From:	Asai Thambi SP <asamymuthupa@...ron.com>
To:	Jens Axboe <axboe@...nel.dk>
CC:	<linux-kernel@...r.kernel.org>,
	Sam Bradshaw <sbradshaw@...ron.com>,
	Selvan Mani <smani@...ron.com>,
	Rajesh Kumar Sambandam <rsambandam@...ron.com>,
	Vignesh Gunasekaran <vgunasekaran@...ron.com>
Subject: [PATCH 08/10] mtip32xx: Handle FTL rebuild failure state during
 device initialization



Allow device initialization to finish gracefully when it is in
FTL rebuild failure state. Also, recover device out of this state
after successfully secure erasing it.

Signed-off-by: Selvan Mani <smani@...ron.com>
Signed-off-by: Vignesh Gunasekaran <vgunasekaran@...ron.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@...ron.com>
---
 drivers/block/mtip32xx/mtip32xx.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 85c1794..96721c0 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -699,7 +699,7 @@ static void mtip_handle_tfe(struct driver_data *dd)
             fail_reason = "thermal shutdown";
         }
         if (buf[288] == 0xBF) {
-            set_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag);
+            set_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag);
             dev_info(&dd->pdev->dev,
                 "Drive indicates rebuild has failed. Secure erase required.\n");
             fail_all_ncq_cmds = 1;
@@ -1034,6 +1034,7 @@ static bool mtip_pause_ncq(struct mtip_port *port,
              fis->features == 0x62 || fis->features == 0x26 ||
              fis->features == 0x12))) {
         clear_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag);
+        clear_bit(MTIP_DDF_REBUILD_FAILED_BIT, &port->dd->dd_flag);
         mtip_bdev_unclaim(port->dd);
         /* Com reset after secure erase or lowlevel format */
         mtip_restart_port(port);
@@ -1218,6 +1219,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
         if ((rv = wait_for_completion_interruptible_timeout(
                 &wait,
                 msecs_to_jiffies(timeout))) <= 0) {
+
             if (rv == -ERESTARTSYS) { /* interrupted */
                 dev_err(&dd->pdev->dev,
                     "Internal command [%02X] was interrupted after %u ms\n",
@@ -3153,7 +3155,7 @@ static int mtip_hw_get_identify(struct driver_data *dd)
         if (buf[288] == 0xBF) {
             dev_info(&dd->pdev->dev,
                 "Drive indicates rebuild has failed.\n");
-            /* TODO */
+            set_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag);
         }
     }
 
@@ -3756,10 +3758,9 @@ static int mtip_submit_request(struct blk_mq_hw_ctx *hctx, struct request *rq)
                 rq_data_dir(rq))) {
             return -ENODATA;
         }
-        if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag)))
+        if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag) ||
+            test_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag)))
             return -ENODATA;
-        if (test_bit(MTIP_DDF_REBUILD_FAILED_BIT, &dd->dd_flag))
-            return -ENXIO;
     }
 
     if (rq->cmd_flags & REQ_DISCARD) {
-- 
1.7.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ