From nobody@FreeBSD.org  Wed Mar 15 01:49:10 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21])
	by hub.freebsd.org (Postfix) with ESMTP id 4795E37B983
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Mar 2000 01:49:10 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.9.3/8.9.2) id BAA01352;
	Wed, 15 Mar 2000 01:49:10 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Message-Id: <200003150949.BAA01352@freefall.freebsd.org>
Date: Wed, 15 Mar 2000 01:49:10 -0800 (PST)
From: aef@cliph.keytown.com
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: /bin/cp failed on some synthetic vfs
X-Send-Pr-Version: www-1.0

>Number:         17389
>Category:       bin
>Synopsis:       /bin/cp failed on some synthetic vfs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 15 01:50:01 PST 2000
>Closed-Date:    Sat Jul 12 22:45:47 PDT 2003
>Last-Modified:  Sat Jul 12 22:45:47 PDT 2003
>Originator:     Andrew Filonov
>Release:        4.0-CURRENT
>Organization:
n/a
>Environment:
FreeBSD aef 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Fri Mar 10 16:19:21 MSK 2000     root@aef:/usr/src/sys/compile/AEF  i386
>Description:
When i copy file from synthetic vfs (portalfs), /bin/cp
use mmap for source file and failed with EINVAL error
cp /portal/tcp/localhost/daytime somefile
>How-To-Repeat:
100%
>Fix:
Check st_blocks value. For synthetic file - always 0.
Simple path for src/bin/cp/utils.c

128c128
<       if (S_ISREG(fs->st_mode) && fs->st_size <= 8 * 1048576) {
---
>       if (S_ISREG(fs->st_mode) && fs->st_size <= 8 * 1048576 && fs->st_blocks
> 0) {


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Sat Jul 12 22:45:00 PDT 2003 
State-Changed-Why:  
As you discovered, there are a number of problems with 
certain FS implementations on FreeBSD, but hacking cp so it 
won't work with any of them isn't the solution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17389 
>Unformatted:
