Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621994 - emerge -v1 -d --nodeps =sys-kernel/gentoo-sources-4.9.32 failure on btrfs
Summary: emerge -v1 -d --nodeps =sys-kernel/gentoo-sources-4.9.32 failure on btrfs
Status: RESOLVED NEEDINFO
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 635020
  Show dependency tree
 
Reported: 2017-06-17 09:23 UTC by Octavian
Modified: 2023-01-17 02:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info,4.91 KB, text/plain)
2017-06-17 09:23 UTC, Octavian
Details
another failing emerge. (build.log.gz,94.38 KB, text/plain)
2017-06-19 13:56 UTC, Octavian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Octavian 2017-06-17 09:23:53 UTC
Created attachment 476734 [details]
emerge --info

emerge -v1 -d --nodeps =sys-kernel/gentoo-sources-4.9.32

....

--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/gentoo-sources-4.9.32/
!!! copy /var/tmp/portage/sys-kernel/gentoo-sources-4.9.32/image/usr/share/doc/gentoo-sources-4.9.32/0000_README.bz2 -> /usr/share/doc/gentoo-sources-4.9.32/0000_README.bz2 failed.
!!! [Errno 22] Invalid argument
....

This is the first file to get copied.
Comment 1 Octavian 2017-06-17 10:02:11 UTC
ls -al /usr/share/doc/gentoo-sources-4.9.32/

-rw-rw-rw- 1 root root 0 Jun 17 10:42 /usr/share/doc/gentoo-sources-4.9.32/0000_README.bz2#new
Comment 2 Octavian 2017-06-19 13:56:06 UTC
Created attachment 477212 [details]
another failing emerge.

All emerges suffer from the same issue. I added -d during emerge but still cannot get a clue what is happening. 

See the attached log file.

I would appreciate some help since I cannot emerge any packages anymore. It must be something very simple.
Comment 3 Octavian 2017-06-19 19:25:53 UTC
Something similar with Bug 402323 but -xattr does not make any difference.
Comment 4 Octavian 2017-06-19 20:46:07 UTC
I think I found the issue:

It's related to btrfs.
Although I have the partitions for a long time the failure appeared this month.

I have the following btrfs subvolumes: 

btrfs subvolume list   /
ID 1473 gen 2152663 top level 5 path var/tmp
....


If I change PORTAGE_TMPDIR=/tmp emerge <whatever> then it works since it is on the same volume with the files being installed. 

Could you check that copying over different subvolumes in btrfs still works?

Best regards,
Octavian

P.S.
I used btrfs subvolume create btrfs partitions.
Comment 5 Zac Medico gentoo-dev 2017-06-25 08:04:45 UTC
As a workaround, you can add a setting like this to /etc/portage/package.use:

sys-apps/portage -native-extensions

It works for me with btrfs subvolumes on 4.9.31 kernel. For example:

> # btrfs subvolume create /src
> Create subvolume '//src'
> # btrfs subvolume create /dst
> Create subvolume '//dst'
> # echo foo > /src/foo
> # strace python -c 'from portage.util.file_copy import copyfile; copyfile("/src/foo", "/dst/foo")' &> /strace.log

In strace.log it shows copy_file_range succeed:

> lseek(3, 0, SEEK_DATA)                  = 0
> lseek(3, 0, SEEK_HOLE)                  = 4
> lseek(3, 0, SEEK_SET)                   = 0
> copy_file_range(3, NULL, 4, [0], 4, 0)  = 4
> lseek(3, 4, SEEK_DATA)                  = -1 ENXIO (No such device or address)
> lseek(3, 0, SEEK_END)                   = 4
> ftruncate(4, 4)                         = 0
> close(4)                                = 0
> close(3)                                = 0