Is mmap() broken for files kept on ext2fs?

From: Wojciech A. Koszek <dunstan_at_freebsd.czest.pl>
Date: Mon, 15 Aug 2005 20:04:13 +0000
Hello,
I get easily repeatable problem with mmap(). Is file lies on Ext2
filesystem, I get EINVAL. In order to confirm it, could someone try to copy
files from Ext2fs to UFS (/bin/cp compiled with
-DVM_AND_BUFFER_CACHE_SYNCHRONIZED, which is default).

Additionally:
http://freebsd.czest.pl/dunstan/FreeBSD/mmapfile/mmapfile.c

[..]
mdconfig -a -t malloc -s 10m
md1
# mkfs.ext2 /dev/md1
mke2fs 1.38 (30-Jun-2005)
[..]
# mount_ext2fs /dev/md1 /mnt

# dd if=/dev/zero of=/mnt/somefile
3018+0 records in
3017+0 records out
1544704 bytes transferred in 0.073870 secs (20911130 bytes/sec)
# ls /mnt/somefile 
12 -rw-r--r--  1 root  wheel  1545216 Aug 15 21:45 /mnt/somefile
# ./mmapfile /mnt/somefile 
mmapfile: mmap(): Invalid argument

- 
* Wojciech A. Koszek && dunstan_at_FreeBSD.czest.pl
Received on Mon Aug 15 2005 - 17:49:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:41 UTC