lkml.org 
[lkml]   [2004]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4][diskdump] x86-64 support
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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site