On Sunday, August 26, 2007 at 17:47:32 CEST, Rainer J.H. Brandt wrote:
> Ronald Kuehn writes:
> > On Sunday, August 26, 2007 at 16:36:26 CEST, Rainer J.H. Brandt wrote:
> > 
> > > Ronald Kuehn writes:
> > > > No. You can neither access ZFS nor UFS in that way. Only one
> > > > host can mount the file system at the same time (read/write or
> > > > read-only doesn't matter here).
> > > 
> > > I can see why you wouldn't recommend trying this with UFS
> > > (only one host knows which data has been committed to the disk),
> > > but is it really impossible?
> > > 
> > > I don't see why multiple UFS mounts wouldn't work, if only one
> > > of them has write access.  Can you elaborate?
> > 
> > Hi,
> > 
> > UFS wasn't designed as a shared file system. The kernel
> > always assumes it is the only party accessing or modifying
> > any on-disk data structures. With that premise it uses caching
> > quite heavily. The view of the file system (cached structures + on-disk
> > state) is consistent. The on-disk state alone isn't while the
> > file system is mounted. Any other system accessing the on-disk
> > state w/o taking into consideration the data cached on the original
> > host will probably see inconsistencies. This will lead to data corruption
> > and panics. If only one system mounts the file system read/write
> > and other hosts only mount it read-only the read-only hosts will
> > get an inconsistent view of the file system because they don't know
> > what's in the cache of the r/w host.
> > 
> > These approaches exist to solve this problem:
> > - Only allow one host to directly access the file system. Other
> >   systems access it by talking over the network to this host:
> >   + NFS
> >   + the pxfs layer of Sun Cluster (global file system)
> > - Use a file system designed with some kind of co-ordination for parallel
> >   access to the on-disk data structures built in:
> >   + QFS (Shared mode uses a meta data server on one host to
> >     manage the right to access certain parts of the on-disk structures.
> >     The operation on the data itself then takes place over the storage
> >     path. In that case multiple systems can modify on-disk structures
> >     directly. They only need to ask the meta data server for permission.)
> > 
> > I hope that helps,
> > Ronald
> 
> Yes, thank you for confirming what I said.
> 
> So it is possible, but not recommended, because I must take care
> not to read from files for which buffers haven't been flushed yet.

It is technically possible to mount the file system on more than
one system, but it _will_ lead to data corruption and panics. 
Just making sure buffers for a file have been flushed to disk
on the writer is _not_ enough. So it is not only not recommended,
it is practically not possible to do such a configuration in a safe
way. There is no way to force the read-only host to only read the
data when they are consistent. Even on a lower level, writes to the
file system are not atomic. When the read-only host picks up data
while the other hosts update is not complete it will get random
inconsistencies instead of correct meta-data.

So as a summary: No way to do that with current UFS.

Ronald
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to