summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/disk-pager.c7
-rw-r--r--libdiskfs/diskfs-pager.h6
2 files changed, 9 insertions, 4 deletions
diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
index 7af0e3ba..886ce157 100644
--- a/libdiskfs/disk-pager.c
+++ b/libdiskfs/disk-pager.c
@@ -84,6 +84,7 @@ diskfs_start_disk_pager (struct user_pager_info *upi,
static void
fault_handler (int sig, long int sigcode, struct sigcontext *scp)
{
+ jmp_buf *env;
error_t err;
#ifndef NDEBUG
@@ -102,8 +103,10 @@ fault_handler (int sig, long int sigcode, struct sigcontext *scp)
}
#endif
+ env = &diskfs_exception_diu->env;
+
/* Clear the record, since the faulting thread will not. */
- diskfs_exception_diu = NULL;
+ diskfs_exception_diu = diskfs_exception_diu->next;
/* Fetch the error code from the pager. */
assert_backtrace (scp->sc_error == EKERN_MEMORY_ERROR);
@@ -111,5 +114,5 @@ fault_handler (int sig, long int sigcode, struct sigcontext *scp)
assert_backtrace (err);
/* Make `diskfault_catch' return the error code. */
- longjmp (diskfs_exception_diu->env, err);
+ longjmp (*env, err);
}
diff --git a/libdiskfs/diskfs-pager.h b/libdiskfs/diskfs-pager.h
index e8227413..f490e776 100644
--- a/libdiskfs/diskfs-pager.h
+++ b/libdiskfs/diskfs-pager.h
@@ -48,9 +48,11 @@ struct disk_image_user
struct disk_image_user *next;
};
-/* Return zero now. Return a second time with a nonzero error_t
+/* Returns zero now. Returns a second time with a nonzero error_t
if this thread faults accessing `disk_image' before calling
- `diskfs_end_catch_exception' (below). */
+ `diskfs_end_catch_exception' (below), in which case
+ diskfs_end_catch_exception should not be called and the access should be
+ avoided. */
#define diskfs_catch_exception() \
({ \
struct disk_image_user *diu = alloca (sizeof *diu); \