Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 483516 - doins ${FILESDIR}/foo fails to work when ${FILESDIR} is on ZFS with portage 2.2.1 and FEATURES=xattr
Summary: doins ${FILESDIR}/foo fails to work when ${FILESDIR} is on ZFS with portage 2...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Richard Yao (RETIRED)
Whiteboard: Python xattr.list() reads regular fil...
Depends on:
Blocks: 465000
  Show dependency tree
Reported: 2013-09-03 19:18 UTC by Rick Farina (Zero_Chaos)
Modified: 2014-06-24 16:45 UTC (History)
2 users (show)

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

portage- build.log (s20QgJnKjL.txt,3.21 KB, text/plain)
2013-09-03 19:19 UTC, Rick Farina (Zero_Chaos)
portage-2.2.1 build.log (s21CsnmsY2.txt,4.13 KB, text/plain)
2013-09-03 19:19 UTC, Rick Farina (Zero_Chaos)

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Farina (Zero_Chaos) gentoo-dev 2013-09-03 19:18:33 UTC
In the 1000+ ebuilds I install every day, it looks like just one, net-wireless/hidclient, fails with this.  I can install hidclient with sys-apps/portage- but not 2.2.1.
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-03 19:19:18 UTC
Created attachment 357784 [details]
portage- build.log
Comment 2 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-03 19:19:51 UTC
Created attachment 357786 [details]
portage-2.2.1 build.log
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-03 20:09:03 UTC
debug patches from Zac show this:

>>> Install hidclient-20120728 into /var/tmp/portage/net-wireless/hidclient-20120728/image/ category net-wireless
Traceback (most recent call last):
  File "/usr/lib64/portage/bin/", line 180, in copy_xattrs
    _copyxattr(s, abs_path, exclude=exclude)
  File "/usr/lib64/portage/pym/portage/util/", line 112, in _copyxattr
portage.exception.OperationNotSupported: Filesystem containing file '/usr/portage/net-wireless/hidclient/files/README' does not support listing of extended attributes
!!! install: copy_xattrs failed with the following arguments: -m0644 /usr/portage/net-wireless/hidclient/files/README /var/tmp/portage/net-wireless/hidclient-20120728/image/usr/share/doc/hidclient-20120728//
!!! dodoc: /usr/portage/net-wireless/hidclient/files/README does not exist
 * ERROR: net-wireless/hidclient-20120728::gentoo failed (install phase):
 *   dodoc failed

Does ZFS lack xattr support?
Comment 5 Richard Yao (RETIRED) gentoo-dev 2013-09-03 20:23:06 UTC
It looks like the listxattr VFS call is broken on ZFS. This can be reproduced easily by doing `listxattr /path/to/anything` on ZFS.

I am reassigning this to myself putting the hardened team on CC.
Comment 6 Richard Yao (RETIRED) gentoo-dev 2013-09-04 01:48:37 UTC
A fix has been sent upstream for review:

I consider this to be a high priority issue, so I intend to merge the fix into the zfs-kmod package by committing 0.6.2-r1 soon. I would like Rick Farina to confirm that it resolves the problem for him before I do that. The patch can be installed via epatch_user:

mkdir -p /etc/portage/patches/sys-fs/zfs-kmod-0.6.2
curl > /etc/portage/patches/sys-fs/zfs-kmod-0.6.2/zfs-kmod-read-file-attribute-support.patch

A rebuild of zfs-kmod, a rebuild of any initramfs being used and a reload of the module (a reboot if ZFS is your rootfs) will apply the patch.
Comment 7 Richard Yao (RETIRED) gentoo-dev 2013-09-04 06:44:19 UTC
Upstream confirmed that the fix was sane, but refused to merge it because they would like support for both getting and setting file attributes to be implemented at the same time. Additionally, they pointed out that this regression was caused by the following commit:

I have rewritten the patch and refreshed the pull request. It now includes support for reading and writing file attributes. I had feedback from upstream while working on it, so it should be sane. As soon as I get confirmation from upstream that it is sane and Rick that it fixes his issue, I will commit -r1 with the fix.
Comment 8 Richard Yao (RETIRED) gentoo-dev 2013-09-04 06:47:37 UTC
Also, I should mention that the commmit that python's xattr.list() checks both regular file attributes and extended file attributes. Had it not been for that, there would not have been a problem when the return values in zpl_ioctl() were changed.
Comment 9 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-17 17:37:36 UTC
Traceback (most recent call last):
  File "/usr/lib64/portage/bin/", line 248, in <module>
  File "/usr/lib64/portage/bin/", line 243, in main
    returncode = copy_xattrs(opts, files)
  File "/usr/lib64/portage/bin/", line 179, in copy_xattrs
    _copyxattr(s, abs_path, exclude=exclude)
  File "/usr/lib64/portage/pym/portage/util/", line 101, in _copyxattr
    attrs = xattr.list(src)
IOError: [Errno 95] Operation not supported

After patch, rebuild of zfs-kmod, and reboot.
Comment 10 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-30 14:41:32 UTC
Where are we on this? I haven't been able for weeks (since the update to portage 2.2).  I'm about ready to clear ZFS from the system.
Comment 11 Richard Yao (RETIRED) gentoo-dev 2014-05-01 17:37:35 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #10)
> Where are we on this? I haven't been able for weeks (since the update to
> portage 2.2).  I'm about ready to clear ZFS from the system.

A proper fix was merged upstream today:

I need to try to reproduce this to verify that commit fixes it. I will backport the commit shortly if it does, but I suspect that is the case.
Comment 12 Richard Yao (RETIRED) gentoo-dev 2014-06-24 16:45:50 UTC
I am fairly confident that this was fixed in either 0.6.2-r5 or 0.6.3. I am closing it as such.