Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2005 20:04:13 +0000
From:      "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
To:        freebsd-current@FreeBSD.org
Subject:   Is mmap() broken for files kept on ext2fs?
Message-ID:  <20050815200412.GA53364@freebsd.czest.pl>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.czest.pl



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050815200412.GA53364>