bugfix for nfsd commit for ZFS

Rick Macklem rmacklem at uoguelph.ca
Mon Apr 13 21:57:02 UTC 2015


Hi,

mav@ identified a fairly serious problem with the NFS server
when ZFS volumes are exported. After a series of Unstable Write RPCs,
the NFS client will do a Commit RPC to ensure the data is safely on
stable storage.

The NFS server implementation did this with a loop running through the
buffer cache blocks for smaller commit sizes. This obviously doesn't
work for ZFS, since it doesn't use the buffer cache. To fix this, ZFS
must always call VOP_FSYNC() instead of doing this loop.

After discussion with mav@ and kib@, it seemed that the preferred solution
is to have file systems that use the buffer cache set MNTK_USES_BCACHE,
so that the NFS server's commit will always use VOP_FSYNC() for file
systems that don't set this.
Old file system modules that do not set the flag should be ok, since
always calling VOP_FSYNC() may be suboptimal, but will still be correct.
"unionfs" never sets this flag, since it would be incorrect if one of
the file systems has it set and the other not set. (Since unionfs mounts
cannot be exported for NFS, I think this is ok.)

If anyone has comments w.r.t. this or would like to review the patch
(already reviewed by kib@), I've attached the current patch.

rick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit.patch
Type: text/x-patch
Size: 4540 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20150413/5e0ab883/attachment.bin>


More information about the freebsd-fs mailing list