Sarah Jelinek wrote On 12/01/05 14:49,:> Hi All,
>
> I have some implementation questions about the zvol capability.
> According to Eric''s picture at:
>
> http://opensolaris.org/os/community/zfs/source
>
> The zvol interfaces do not talk to the ZAP interfaces. The only
> thing I can find in the zvol code is that it uses the ZAP
> for size(volsize). Is this the only attributes it gets/sets
> from the ZAP?
Eric answered this one.
> Also, again from the picture and looking at the source, it
> doesn''t look like zvol uses the ZIL interfaces in any way.
Correct. The ZIL is only currently used for the POSIX transactions
of the ZPL, though is potentially useful for any client that wishes
to ensure transactions are on stable storage.
> So, if this is true, does
> that mean that data is written immediately to disk through the zvol
> interfaces? Well by immediately I mean they are never written to the
> intent log, it may be cached intermediately at some point, correct?.
> And, if you open the device with O_DSYNC I assume they will
> get written immediately to disk?
It looks like spec_write() will not set the the segmap_release()
flags to SM_ASYNC if FDSYNC (O_DSYNC) is set. Looking at
zvol_strategy() which segmap_release() eventually calls to
put any page, it ignores B_ASYNC. As soon as dmu_write() returns
the IO is marked as complete by biodone(). I think this is a bug.
It should wait until they are committed using txg_wait_synced()
(which would be very slow) or use the ZIL to log the page.
Fixing ZVOL to use the ZIL would take a while, but might be
a useful exercise to validate the ZIL architecture using
a different client.
Anyway I think a bug needs to be raised against ZVOL not
honoring O_DSYNC semantics. Thanks for bringing this to our
attention (and making me familiarise myself with ZVOL!).
>
> thanks,
> sarah
Neil