summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/grub/grub-0.97/stage2/disk_io.c7
-rw-r--r--usr/src/grub/grub-0.97/stage2/fsys_zfs.c8
2 files changed, 8 insertions, 7 deletions
diff --git a/usr/src/grub/grub-0.97/stage2/disk_io.c b/usr/src/grub/grub-0.97/stage2/disk_io.c
index bcb37febba..5e767dc747 100644
--- a/usr/src/grub/grub-0.97/stage2/disk_io.c
+++ b/usr/src/grub/grub-0.97/stage2/disk_io.c
@@ -431,15 +431,8 @@ attempt_mount (void)
{
#ifndef STAGE1_5
for (fsys_type = 0; fsys_type < NUM_FSYS; fsys_type++)
- {
- /*
- * (re)set errnum to 0 in order to clear any state that may have
- * been left from a previous mount (or other) routine.
- */
- errnum = 0;
if ((fsys_table[fsys_type].mount_func) ())
break;
- }
if (fsys_type == NUM_FSYS && errnum == ERR_NONE)
errnum = ERR_FSYS_MOUNT;
diff --git a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
index 8d5be46475..1d8c99b443 100644
--- a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
+++ b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
@@ -1283,6 +1283,7 @@ zfs_mount(void)
char tmp_devid[MAXNAMELEN];
uint64_t tmp_guid;
uint64_t adjpl = (uint64_t)part_length << SPA_MINBLOCKSHIFT;
+ int err = errnum; /* preserve previous errnum state */
/* if it's our first time here, zero the best uberblock out */
if (best_drive == 0 && best_part == 0 && find_best_root) {
@@ -1340,6 +1341,13 @@ zfs_mount(void)
}
}
+ /*
+ * While some fs impls. (tftp) rely on setting and keeping
+ * global errnums set, others won't reset it and will break
+ * when issuing rawreads. The goal here is to simply not
+ * have zfs mount attempts impact the previous state.
+ */
+ errnum = err;
return (0);
}