From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 20 06:40:05 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20A8116A41F for ; Fri, 20 Jan 2006 06:40:05 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF17943D49 for ; Fri, 20 Jan 2006 06:40:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0K6e4lb069953 for ; Fri, 20 Jan 2006 06:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0K6e4n9069952; Fri, 20 Jan 2006 06:40:04 GMT (envelope-from gnats) Resent-Date: Fri, 20 Jan 2006 06:40:04 GMT Resent-Message-Id: <200601200640.k0K6e4n9069952@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nate Eldredge Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8633716A41F for ; Fri, 20 Jan 2006 06:34:40 +0000 (GMT) (envelope-from nge@cs.hmc.edu) Received: from turing.cs.hmc.edu (turing.cs.hmc.edu [134.173.42.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 516D543D45 for ; Fri, 20 Jan 2006 06:34:40 +0000 (GMT) (envelope-from nge@cs.hmc.edu) Received: by turing.cs.hmc.edu (Postfix, from userid 26983) id AB87D53227; Thu, 19 Jan 2006 22:34:39 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.cs.hmc.edu (Postfix) with ESMTP id 95EB45A8D5 for ; Thu, 19 Jan 2006 22:34:39 -0800 (PST) Message-Id: Date: Thu, 19 Jan 2006 22:34:39 -0800 (PST) From: Nate Eldredge To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: kern/92040: mmap/cp fails on small file in UDF X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 06:40:05 -0000 >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: