aboutsummaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-01-11 12:25:15 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-01-11 12:25:43 +0100
commitbf24996d891966454b3395ab965b87c033b21d7d (patch)
tree76fd5567a23fb0b3b3db6f1841a926fed4a6b867 /ext2fs
parentd580a97c6c8a1e1419cc7c21f6dd9d1d12b79f92 (diff)
downloadhurd-bf24996d891966454b3395ab965b87c033b21d7d.tar.gz
hurd-bf24996d891966454b3395ab965b87c033b21d7d.tar.bz2
hurd-bf24996d891966454b3395ab965b87c033b21d7d.zip
libdiskfs: catch mmap failure
Just backtrace for now
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/dir.c5
-rw-r--r--ext2fs/hyper.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ext2fs/dir.c b/ext2fs/dir.c
index faed301e..256f3d36 100644
--- a/ext2fs/dir.c
+++ b/ext2fs/dir.c
@@ -965,7 +965,10 @@ diskfs_get_directs (struct node *dp,
allocsize = round_page (bufsiz);
if (allocsize > *datacnt)
- *data = mmap (0, allocsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
+ {
+ *data = mmap (0, allocsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
+ assert_backtrace (*data != MAP_FAILED);
+ }
/* Set bufp appropriately */
bufp = buf;
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 82b06d17..d2440dc0 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -46,7 +46,7 @@ allocate_mod_map (void)
mod_map_size = le32toh (sblock->s_blocks_count) >> 3;
modified_global_blocks = mmap (0, mod_map_size, PROT_READ|PROT_WRITE,
MAP_ANON, 0, 0);
- assert_backtrace (modified_global_blocks != (void *) -1);
+ assert_backtrace (modified_global_blocks != MAP_FAILED);
}
else
modified_global_blocks = 0;