Newbie: multiple initiator contention resolution?
Hello all,
I'm an undergraduate at a UK university, and I'm very much a newbie to kernel development, so my apologies in advance if my questions sound daft or have been answered before, etc.
I'm doing a project on something which involves writing a LLD for a "fake" disk, similar to scsi_debug. However, the LLD may loaded on multiple hosts, and they all see the same fake disk. Does the sd driver have any kind of built-in contention resolution mechanism for such multiple initiator setups? That is, if I mount a partition on my fake disk simultaneously on more than one host, how do I stop the filesystem from getting corrupted?
Many thanks in advance.
Dan Patton
[email protected]
Quoted 6 lines · Daniel Patton
Hello all,
I'm an undergraduate at a UK university, and I'm very much a newbie to kernel development, so my apologies in advance if my questions sound daft or have been answered before, etc.
Quoted 8 lines
I'm doing a project on something which involves writing a LLD for a "fake" disk, similar to
scsi_debug. However, the LLD may loaded on multiple hosts, and they all see the same fake disk. Does the sd driver have any kind of built-in contention resolution mechanism for such multiple initiator setups? That is, if I mount a partition on my fake disk simultaneously on more than one host, how do I stop the filesystem from getting corrupted?
You have to use some form of external locking mechanism, most often. Most filesystems do not support such a thing. Check out opengfs (use google) for an example of one that does.
Quoted 9 lines
Many thanks in advance.
Dan Patton
[email protected]-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Steven Dake
You have to use some form of external locking mechanism, most often. Most filesystems do not support such a thing. Check out opengfs (use google) for an example of one that does.
Many thanks, I will look into this. I don't understand why SCSI RESERVE/RELEASE can't be used as the locking mechanism though. Call me stupid, but I'm only a student.
As an aside, can you (or anyone) see even the *vaguest* possible use for my project? It basically allows you to construct a "virtual" switching fabric with an arbitrary topology, attach a few fake disks to it, then load an LLD on various hosts and they all see all the fake disks.
Dan Patton
[email protected]
Quoted 7 lines
Steven Dake wrote:
You have to use some form of external locking mechanism, most often.
Quoted 3 lines
Most filesystems do not support such a thing. Check out opengfs (use google) for an example of one that does.
Daniel Patton:
Quoted 3 lines
Many thanks, I will look into this. I don't understand why SCSI RESERVE/RELEASE can't be used as the locking mechanism though. Call me stupid, but I'm only a student.
You _can_ use SCSI RESERVE/RELEASE for the locking. The locking doesn't have to be external to the SCSI channel -- it has to be external to the device driver. The reason is that every filesystem driver I know caches information from the disk -- above the device driver.
So the filesystem drivers on the various accessing systems would have to use a locking mechanism (possibly with a lock based on SCSI RESERVE/RELEASE) to communicate amongst themselves and coordinate their caches.
There's also the matter of multi-write updates that have to be atomic. That's a problem naturally solved with SCSI RESERVE/RELEASE, but it still has to be handled external to the device driver.