The latest lustre will not build against ZFS master:
CC [M] /home/hutter/lustre-release/lustre/osd-zfs/osd_handler.o
In file included from /home/hutter/lustre-release/lustre/osd-zfs/osd_handler.c:52:0:
/home/hutter/lustre-release/lustre/osd-zfs/osd_internal.h: In function 'osd_sa_handle_get':
/home/hutter/lustre-release/lustre/osd-zfs/osd_internal.h:929:2: error: implicit declaration of function 'refcount_add' [-Werror=implicit-function-declaration]
refcount_add was removed in ZFS in:
Linux 4.19-rc3+ compat: Remove refcount_t compat (https://github.com/zfsonlinux/zfs/pull/7932).
That patch is expected to be included in zfs-0.7.12 as well.
Lustre should be updated to use zfs_refcount_add() if it exists, and then fall back to refcount_add if not.