kern/87959: ext2fs: no cp(1) possible, mmap returns EINVAL

Matthias Andree matthias.andree at gmx.de
Mon Oct 24 16:00:28 PDT 2005


>Number:         87959
>Category:       kern
>Synopsis:       ext2fs: no cp(1) possible, mmap returns EINVAL
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 24 23:00:26 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Bourne-again Superuser
>Release:        FreeBSD 6.0-RC1 i386
>Organization:
>Environment:
System: FreeBSD rho.emma.line.org 6.0-RC1 FreeBSD 6.0-RC1 #7: Mon Oct 24 18:20:44 CEST 2005 toor at rho.emma.line.org:/usr/obj/usr/src/sys/SIGMA i386


	
>Description:
Taken from http://docs.freebsd.org/cgi/mid.cgi?m37je55eb8.fsf
-------------------------------------------------------------
I mounted a Linux ext3 as ext2fs, which worked fine. However, trying to cvsupd
or cp data out of the partition was refused, tracing the processes revealed
that mmap() returned EINVAL.

rsync(1) (from ports) worked though.

Additional information (not in the original report on current@)
----------------------
The problem was originally reported against FreeBSD 6.0-BETA3 bug persists in
6.0-RC1 (i386) that was CVSupped on the UTC afternoon of 2005-10-24, fresh
kernel + world builds were WITHOUT -DNOCLEAN and with default optimization
options but with CPUTYPE?= athlon-xp.

Excerpt from truss cp:

break(0x805f000)                                 = 0 (0x0)
break(0x8060000)                                 = 0 (0x0)
stat("/linux/.bash_history",0x805f148)           = 0 (0x0)
stat("/tmp/.bash_history",0xbfbfebb0)            = 0 (0x0)
open("/linux/.bash_history",0x0,00)              = 3 (0x3)
open("/tmp/.bash_history",0x401,00)              = 4 (0x4)
mmap(0x0,199,(0x1)PROT_READ,(0x1)MAP_SHARED,3,0x0) ERR#22 'Invalid argument'
cp: write(2,0xbfbfe4c0,4)                                = 4 (0x4)
/linux/.bash_historywrite(2,0xbfbfe4e0,20)                               = 20 (0x14)
: write(2,0x281423ec,2)                          = 2 (0x2)
Invalid argument
write(2,0xbfbfe4c0,17)                           = 17 (0x11)

	
>How-To-Repeat:
	
1. (if needed) create an ext2fs
2. mount pre-existing ext2fs, perhaps writing some files to it
3. try to "cp" a regular file from ext2fs to some other filesystem, for instance:
   cp /linux/.bash_history /tmp/
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list