Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jan 2006 22:34:39 -0800 (PST)
From:      Nate Eldredge <nge@cs.hmc.edu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/92040: mmap/cp fails on small file in UDF
Message-ID:  <Pine.GSO.4.63.0601192232560.13186@turing>
Resent-Message-ID: <200601200640.k0K6e4n9069952@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         92040
>Category:       kern
>Synopsis:       mmap/cp fails on small file in UDF
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 20 06:40:04 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Nate Eldredge
>Release:        FreeBSD 6.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD vulcan.lan 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Dec 14 20:08:57 PST 2005 nate@vulcan.lan:/usr/obj/usr/src/sys/VULCAN amd64



>Description:
If you try to copy a small file from a UDF filesystem, cp fails with EINVAL.

The underlying cause is that cp attempts to copy small files using mmap,
and mmap fails in this case.  I don't know whether cp is calling it wrong,
or mmap is simply unimplemented for udf, or if there is some other reason
for the failure.

In any case, it is probably a good idea for cp to fall back to read() if
mmap doesn't work.  It might also be useful to be able to explicitly
tell it to use read().  For example, I don't know what the mmap approach
will do in the presence of I/O errors.  I'm worried that it might silently
make a corrupt copy of the file.

This is on amd64.

Perhaps this bug should be cross-filed in category bin, if that is possible.
I don't know how to do that.

>How-To-Repeat:
nate@vulcan:~/bugs/udf$ mkdir dir
nate@vulcan:~/bugs/udf$ cat >dir/hello
hello world
nate@vulcan:~/bugs/udf$ mkisofs -o img -udf dir/
...
vulcan#	mdconfig -a -t vnode -f img
md0
vulcan#	mount_udf /dev/md0 /mnt/md0
vulcan#	ls -l /mnt/md0
total 0
-r--r--r--  1 root  wheel  12 Jan 20 22:10 hello
vulcan#	cat /mnt/md0/hello
hello world
vulcan#	cp /mnt/md0/hello .
cp: /mnt/md0/hello: Invalid argument

Script done on Thu Jan 19 22:11:55 2006
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



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