summaryrefslogtreecommitdiff
path: root/fatfs
diff options
context:
space:
mode:
Diffstat (limited to 'fatfs')
-rw-r--r--fatfs/fat.c2
-rw-r--r--fatfs/inode.c2
-rw-r--r--fatfs/pager.c11
3 files changed, 9 insertions, 6 deletions
diff --git a/fatfs/fat.c b/fatfs/fat.c
index f31ce115..e765376d 100644
--- a/fatfs/fat.c
+++ b/fatfs/fat.c
@@ -606,8 +606,8 @@ fat_get_freespace (void)
if (next_cluster == FAT_FREE_CLUSTER)
free_clusters++;
}
+ diskfs_end_catch_exception ();
}
- diskfs_end_catch_exception ();
return free_clusters;
}
diff --git a/fatfs/inode.c b/fatfs/inode.c
index c38ee0d9..cefcba47 100644
--- a/fatfs/inode.c
+++ b/fatfs/inode.c
@@ -533,8 +533,8 @@ diskfs_truncate (struct node *node, loff_t length)
{
fat_truncate_node(node, round_cluster(length) >> log2_bytes_per_cluster);
node->allocsize = round_cluster(length);
+ diskfs_end_catch_exception ();
}
- diskfs_end_catch_exception ();
node->dn_set_mtime = 1;
node->dn_set_ctime = 1;
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. */