| Summary: | /bin/cp failed on some synthetic vfs | ||
|---|---|---|---|
| Product: | Base System | Reporter: | aef <aef> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed 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. |
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 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) { How-To-Repeat: 100%