Re: [PATCH 4/4][diskdump] x86-64 support

From: Lee Revell
Date: Sat Sep 04 2004 - 17:32:14 EST


On Tue, 2004-08-31 at 05:10, Takao Indoh wrote:
> >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.
>
> Could you explain to me why spin_is_locked is not safe?
>

Say you have a door with a lock, and someone on the other side. You
look at the lock, see that it's unlocked, then open the door. You
cannot guarantee that the door will open because the person on the other
side could have locked it between the time you looked and turned the
handle.

The only way to know for sure whether the door is locked is to turn the
handle and see if it opens.

Lee

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