From 8c4b37178c8e7cfcbb37682180c697cb6e55cb34 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 19 Apr 2025 22:24:40 +0200 Subject: libdiskfs: Fix catching exceptions This fixes making diskfs_catch_exception recursive, catching the last fault exception, and fixes callers. --- libdiskfs/diskfs-pager.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libdiskfs/diskfs-pager.h') 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); \ -- cgit v1.2.3