summaryrefslogtreecommitdiff
path: root/fatfs/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 /fatfs/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 'fatfs/pager.c')
-rw-r--r--fatfs/pager.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fatfs/pager.c b/fatfs/pager.c
index efe02038..e2302cec 100644
--- a/fatfs/pager.c
+++ b/fatfs/pager.c
@@ -646,12 +646,15 @@ diskfs_grow (struct node *node, loff_t size, struct protid *cred)
if (new_end_cluster > end_cluster)
{
err = diskfs_catch_exception ();
- while (!err && end_cluster < new_end_cluster)
+ if (! err)
{
- cluster_t disk_cluster;
- err = fat_getcluster (node, end_cluster++, 1, &disk_cluster);
+ while (!err && end_cluster < new_end_cluster)
+ {
+ cluster_t disk_cluster;
+ err = fat_getcluster (node, end_cluster++, 1, &disk_cluster);
+ }
+ diskfs_end_catch_exception ();
}
- diskfs_end_catch_exception ();
if (err)
/* Reflect how much we allocated successfully. */