Messages in this thread | | | Subject | Re: [PATCH 4/4][diskdump] x86-64 support | From | Lee Revell <> | Date | Sat, 04 Sep 2004 18:31:31 -0400 |
| |
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |