All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: linux-ide@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jeff Garzik <jgarzik@redhat.com>,
	Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: [PATCH libata/for-4.5-fixes] libata-sff: use WARN instead of BUG on illegal host state machine state
Date: Fri, 29 Jan 2016 07:20:57 -0500	[thread overview]
Message-ID: <20160129121604.GN32380@htj.duckdns.org> (raw)
In-Reply-To: <20160129115214.GM32380@htj.duckdns.org>

>From a588afc920bc50e894f6ae2874c4281c795e0979 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Fri, 29 Jan 2016 07:06:53 -0500

ata_sff_hsm_move() triggers BUG if it sees a host state machine state
that it dind't expect.  The risk for data corruption when the
condition occurs is low as it's highly unlikely that it would lead to
spurious completion of commands.  The BUG occasionally triggered for
subtle race conditions in the driver.  Let's downgrade it to WARN so
that it doesn't kill the machine unnecessarily.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Dmitry Vyukov <dvyukov@google.com>
---
Applied to libata/for-4.5-fixes.

Thanks.

 drivers/ata/libata-sff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index cdf6215..608677d 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1296,7 +1296,8 @@ int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
 		break;
 	default:
 		poll_next = 0;
-		BUG();
+		WARN(true, "ata%d: SFF host state machine in invalid state %d",
+		     ap->print_id, ap->hsm_task_state);
 	}
 
 	return poll_next;
-- 
2.5.0

      parent reply	other threads:[~2016-01-29 12:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 11:35 ata: BUG in ata_sff_hsm_move Dmitry Vyukov
2016-01-29 11:52 ` Tejun Heo
2016-01-29 11:59   ` Dmitry Vyukov
2016-01-29 12:23     ` Tejun Heo
2016-01-29 13:18       ` Dmitry Vyukov
2016-01-29 13:40         ` Dmitry Vyukov
2016-01-29 18:14           ` David Milburn
2016-01-29 20:24             ` Tejun Heo
2016-01-29 20:23           ` Tejun Heo
2016-02-01 10:46             ` Dmitry Vyukov
2016-02-01 16:50               ` [PATCH libata/for-4.5-fixes] libata: fix sff host state machine locking while polling Tejun Heo
2016-01-29 12:20   ` Tejun Heo [this message]

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=20160129121604.GN32380@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=jgarzik@redhat.com \
    --cc=kcc@google.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=sshtylyov@ru.mvista.com \
    --cc=syzkaller@googlegroups.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.