From owner-freebsd-current@FreeBSD.ORG Mon Aug 15 19:49:23 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AD7516A41F for ; Mon, 15 Aug 2005 19:49:23 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (silver.iplus.pl [80.48.250.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id CABC043D46 for ; Mon, 15 Aug 2005 19:49:21 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.12.10/8.12.9) with ESMTP id j7FK4EGW053419 for ; Mon, 15 Aug 2005 20:04:14 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.12.10/8.12.9/Submit) id j7FK4EFs053418 for freebsd-current@FreeBSD.org; Mon, 15 Aug 2005 20:04:14 GMT (envelope-from dunstan) Date: Mon, 15 Aug 2005 20:04:13 +0000 From: "Wojciech A. Koszek" To: freebsd-current@FreeBSD.org Message-ID: <20050815200412.GA53364@freebsd.czest.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: Is mmap() broken for files kept on ext2fs? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2005 19:49:23 -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@FreeBSD.czest.pl