We don't need any actual adjustments as we don't use the affected structures.

Both features are read-incompatible - they are registered without
ZFEATURE_FLAG_READONLY_COMPAT and are therefore recorded in the pool's
features_for_read - so check_mos_features() refuses to mount any pool where
either is active. Neither affects a structure GRUB reads:
com.datto:bookmark_v2 only enlarges bookmark objects and
com.delphix:bookmark_written only adds bookmark accounting fields, while GRUB
never enumerates bookmarks. Note that com.delphix:bookmarks itself is
READONLY_COMPAT and so never appears in features_for_read.

This follows commit c464f1ec3 (fs/zfs/zfs: Mark vdev_zaps_v2 and head_errlog
as supported), which added com.delphix:head_errlog - likewise recorded in
features_for_read and likewise unused by GRUB.

Signed-off-by: Maximo Guk <[email protected]>
---
Found this when a nightly ZFS send/recv backup created a bookmark on the pool
holding /boot. The machine ran fine that day and simply failed to boot on the
next restart, with nothing to indicate what had changed.

Reproduced on Ubuntu 26.04 (GRUB 2.14, OpenZFS 2.4.1), single-pool ZFS root:
creating a bookmark makes "grub-probe --target=fs /" fail (the same
check_mos_features() path used at boot), and destroying it restores both the
feature state and booting.

This is not specific to one backup tool - zrepl, sanoid/syncoid and
zfs-autobackup all create bookmarks to anchor incremental sends without
retaining snapshots. zrepl carries an open issue for the same interaction:
https://github.com/zrepl/zrepl/issues/501

Earlier discussion of GRUB's feature allowlist, including a proposal to relax
check_mos_features() wholesale (this patch is the narrower alternative):
https://github.com/openzfs/zfs/discussions/15169

Happy to test any alternative approach.

 grub-core/fs/zfs/zfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c
index 83dfa6d52..5d0c50b69 100644
--- a/grub-core/fs/zfs/zfs.c
+++ b/grub-core/fs/zfs/zfs.c
@@ -296,6 +296,8 @@ static const char *spa_feature_names[] = {
   "com.klarasystems:vdev_zaps_v2",
   "com.delphix:head_errlog",
   "org.freebsd:zstd_compress",
+  "com.datto:bookmark_v2",
+  "com.delphix:bookmark_written",
   NULL
 };
 
-- 
2.53.0

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to