public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>
Cc: James.Bottomley@HansenPartnership.com, jens.axboe@oracle.com,
	linux-scsi@vger.kernel.org, coldwell@redhat.com, hare@novell.com
Subject: Re: [PATCH 1/1] cciss: resubmit kernel scan thread for MSA2012
Date: Tue, 10 Mar 2009 15:39:33 -0700	[thread overview]
Message-ID: <20090310153933.7a7fc224.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090310163426.GC18243@beardog.cca.cpqcorp.net>


Confused.

> +static int scan_thread(ctlr_info_t *h)
> +{
> +	int rc;
> +	DECLARE_COMPLETION_ONSTACK(wait);
> +	h->rescan_wait = &wait;
> +
> +	while (!kthread_should_stop()) {
> +		rc = wait_for_completion_interruptible(&wait);
> +		if (!rc)
> +			continue;
> +		else
> +			rebuild_lun_table(h, 0);
> +	}
> +	return 0;
> +}

afacit this thread won't ever do anything,

> +static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c)
> +{
> +	if (c->err_info->SenseInfo[2] != UNIT_ATTENTION)
> +		return 0;
> +
> +	switch (c->err_info->SenseInfo[12]) {
> +	case STATE_CHANGED:
> +		printk(KERN_WARNING "cciss%d: a state change "
> +			"detected, command retried\n", h->ctlr);
> +		return 1;
> +	break;
> +	case LUN_FAILED:
> +		printk(KERN_WARNING "cciss%d: LUN failure "
> +			"detected, action required\n", h->ctlr);
> +		return 1;
> +	break;
> +	case REPORT_LUNS_CHANGED:
> +		printk(KERN_WARNING "cciss%d: report LUN data "
> +			"changed\n", h->ctlr);
> +		if (h->rescan_wait)
> +			complete(h->rescan_wait);

because this will cause the wait_for_completion_interruptible() to return 0.

> +		return 1;
> +	break;
> +	case POWER_OR_RESET:
> +		printk(KERN_WARNING "cciss%d: a power on "
> +			"or device reset detected\n", h->ctlr);
> +		return 1;
> +	break;
> +	case UNIT_ATTENTION_CLEARED:
> +		printk(KERN_WARNING "cciss%d: unit attention "
> +		    "cleared by another initiator\n", h->ctlr);
> +		return 1;
> +	break;
> +	default:
> +		printk(KERN_WARNING "cciss%d: unknown "
> +			"unit attention detected\n", h->ctlr);
> +				return 1;
> +	}
> +}


  reply	other threads:[~2009-03-10 22:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 15:17 [PATCH 1/1] cciss: resubmit kernel scan thread for MSA2012 Mike Miller (OS Dev)
2009-03-10 15:46 ` Mike Miller (OS Dev)
2009-03-10 15:50 ` James Bottomley
2009-03-10 16:34   ` Mike Miller (OS Dev)
2009-03-10 22:39     ` Andrew Morton [this message]
2009-03-11 14:31       ` Mike Miller (OS Dev)
2009-03-11 15:21       ` Mike Miller (OS Dev)
2009-03-11 16:17       ` Mike Miller (OS Dev)
2009-03-11 22:14         ` Andrew Morton
2009-03-12 16:26           ` Mike Miller (OS Dev)
2009-06-15 20:39             ` Mike Miller (OS Dev)
2009-06-15 21:25               ` Andrew Morton
2009-06-15 22:17                 ` Mike Miller (OS Dev)
2009-06-15 22:41                   ` Andrew Morton
2009-06-16 19:07                     ` Mike Miller (OS Dev)
2009-06-16 19:17                       ` Andrew Morton

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=20090310153933.7a7fc224.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=coldwell@redhat.com \
    --cc=hare@novell.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cca.cpqcorp.net \
    /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