From: Christoph Hellwig <hch@infradead.org>
To: Takao Indoh <indou.takao@soft.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4][diskdump] x86-64 support
Date: Sat, 28 Aug 2004 11:23:24 +0100 [thread overview]
Message-ID: <20040828112324.B8000@infradead.org> (raw)
In-Reply-To: <8DC48CE421568Cindou.takao@soft.fujitsu.com>; from indou.takao@soft.fujitsu.com on Sat, Aug 28, 2004 at 06:48:11PM +0900
On Sat, Aug 28, 2004 at 06:48:11PM +0900, Takao Indoh wrote:
> +/*
> + * Dump stuff...
> + */
> +#include <linux/diskdump.h>
> +
> +#define MPT_HOST_LOCK(host_lock) \
> + if (crashdump_mode()) \
> + spin_lock(host_lock); \
> + else \
> + spin_lock_irq(host_lock);
> +
> +#define MPT_HOST_UNLOCK(host_lock) \
> + if (crashdump_mode()) \
> + spin_unlock(host_lock); \
> + else \
> + spin_unlock_irq(host_lock);
> +
Please stop this macro madness. Why can't you simply use
spin+lock_irqsave?
> +mptscsih_sanity_check(struct scsi_device *sdev)
> +{
> + MPT_ADAPTER *ioc;
> + MPT_SCSI_HOST *hd;
> +
> + hd = (MPT_SCSI_HOST *) sdev->host->hostdata;
> + if (!hd)
> + return -ENXIO;
> + ioc = hd->ioc;
> +
> + /* message frame freeQ is busy */
> + if (spin_is_locked(&ioc->FreeQlock))
> + return -EBUSY;
As in the scsi code spin_is_locked checks are bogus and racy. Only
a spin_trylock would be safe. hd can't be NULL.
next prev parent reply other threads:[~2004-08-28 10:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-28 9:43 [PATCH 0/4][diskdump] x86-64 support Takao Indoh
2004-08-28 9:44 ` [PATCH 1/4][diskdump] " Takao Indoh
2004-08-28 9:45 ` [PATCH 2/4][diskdump] " Takao Indoh
2004-08-28 10:21 ` Christoph Hellwig
2004-08-28 9:47 ` [PATCH 3/4][diskdump] " Takao Indoh
2004-08-28 9:48 ` [PATCH 4/4][diskdump] " Takao Indoh
2004-08-28 10:23 ` Christoph Hellwig [this message]
2004-08-31 9:10 ` Takao Indoh
2004-09-04 11:11 ` Christoph Hellwig
2004-09-04 22:31 ` Lee Revell
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=20040828112324.B8000@infradead.org \
--to=hch@infradead.org \
--cc=indou.takao@soft.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
/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.