summaryrefslogtreecommitdiff
path: root/ext2fs/pager.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-19 22:24:40 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-19 22:44:49 +0200
commit8c4b37178c8e7cfcbb37682180c697cb6e55cb34 (patch)
tree314d261e82bce7ec96ec26cab00e9375b6fc7979 /ext2fs/pager.c
parentf564f46dad5ccdcb87c7b56d0c58e9afe4ff49f3 (diff)
libdiskfs: Fix catching exceptionsv0.9.git20250420
This fixes making diskfs_catch_exception recursive, catching the last fault exception, and fixes callers.
Diffstat (limited to 'ext2fs/pager.c')
-rw-r--r--ext2fs/pager.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index b93a9edd..c55107a9 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -617,8 +617,8 @@ pager_unlock_page (struct user_pager_info *pager, vm_offset_t page)
break;
left -= block_size;
}
+ diskfs_end_catch_exception ();
}
- diskfs_end_catch_exception ();
if (partial_page)
/* If an error occurred, this page still isn't writable; otherwise,
@@ -711,12 +711,15 @@ diskfs_grow (struct node *node, off_t size, struct protid *cred)
end_block);
err = diskfs_catch_exception ();
- while (!err && end_block < writable_end)
+ if (! err)
{
- block_t disk_block;
- err = ext2_getblk (node, end_block++, 1, &disk_block);
+ while (!err && end_block < writable_end)
+ {
+ block_t disk_block;
+ err = ext2_getblk (node, end_block++, 1, &disk_block);
+ }
+ diskfs_end_catch_exception ();
}
- diskfs_end_catch_exception ();
if (! err)
/* Reflect how much we allocated successfully. */