Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 219844 - USE=xattr sys-apps/coreutils-6.11: cp returns error on tmpfs
Summary: USE=xattr sys-apps/coreutils-6.11: cp returns error on tmpfs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-30 14:04 UTC by Daniel Lin
Modified: 2009-02-22 00:13 UTC (History)
1 user (show)

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


Attachments
strace of failing cp (bad,5.05 KB, text/plain)
2008-04-30 14:09 UTC, Daniel Lin
Details
strace of successful cp (good,4.78 KB, text/plain)
2008-04-30 14:09 UTC, Daniel Lin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Lin 2008-04-30 14:04:56 UTC
sys-kernel/gentoo-sources-2.6.25-r1
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y

When coreutils is built with USE=xattr, cp exits abnormally when copying on a tmpfs mount.

Using "cp --attributes=-" or re-building coreutils with USE=-xattr succeeds.  A downgrade to coreutils-6.10-r1 does not help.

Reproducible: Always

Steps to Reproduce:
1. mount -t tmpfs none /tmp
2. touch /tmp/foo
3. cp /tmp/foo /tmp/bar; echo $?

Actual Results:  
cp: listing attributes of `/tmp/foo': Invalid argument
1


Expected Results:  
0


Portage 2.1.5_rc5 (default-linux/x86/2007.0/desktop, gcc-4.2.3, glibc-2.7-r2, 2.6.25-gentoo-r1 i686)
=================================================================
System uname: 2.6.25-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Timestamp of tree: Mon, 21 Apr 2008 14:00:02 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.2-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -Os -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=pentium4 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg --with-bdeps y"
FEATURES="candy ccache collision-protect distcc distlocks fixpackages metadata-transfer parallel-fetch prelink sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/overlay /usr/portage/local/layman/4nykey /usr/portage/local/layman/armagetron /usr/portage/local/layman/drizzt /usr/portage/local/layman/enlightenment /usr/portage/local/layman/gentopia /usr/portage/local/layman/gnustep /usr/portage/local/layman/hanno-xgl /usr/portage/local/layman/haskell /usr/portage/local/layman/java-overlay /usr/portage/local/layman/java-gcj-overlay /usr/portage/local/layman/kde /usr/portage/local/layman/lila-theme /usr/portage/local/layman/mozilla /usr/portage/local/layman/nx /usr/portage/local/layman/perl-experimental /usr/portage/local/layman/plan9 /usr/portage/local/layman/pro-audio /usr/portage/local/layman/secondlife /usr/portage/local/layman/sunrise /usr/portage/local/layman/flameeyes-overlay /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib accessibility acl acpi alsa apache2 arts audiofile avahi bash-completion berkdb bidi bzip2 cairo calendar canna caps cddb cdparanoia cdr cjk cli consolekit cracklib crypt cscope cups curl dbus dga directfb djbfft dmi doc dri dts dv dvd dvdr dvdread eds emacs emboss encode esd evo examples exif expat fam fastcgi fbcon ffmpeg fftw flac flash fontconfig foomaticdb fortran freewnn ftp gcj gd gdbm ggi gif gimp glitz glut gmp gnome gnustep gnutls gphoto2 gpm graphviz gstreamer gtk gtkhtml guile hal iconv idn ieee1394 imagemagick imap imlib imlib2 ipv6 isdnlog jack java javascript jbig joystick jpeg jpeg2k junit kde kdeenablefinal kdehiddenvisibility kerberos keyring krb4 ladspa lash lcms ldap leim lesstif libcaca libnotify libsamplerate libvisual lm_sensors lua m17n-lib mad maildir mailwrapper matroska mbox midi migemo mikmod mmap mmx mng modplug mono motif mp3 mp4 mpeg mplayer msn mudflap musepack nas ncurses netjack nls nptl nptlonly nsplugin ocaml offensive ogg openal openexr opengl openmp opentype oss pam par pcre pdf perl plotutils png portaudio postgres ppds pppd pulseaudio python qdbm qt3 qt3support qt4 quicktime readline real reflection ruby samba sasl savedconfig scanner sdl seamonkey session shorten slang slp smp sndfile socks5 source sox speex spell spl sqlite sqlite3 sse sse2 ssl startup-notification svg svga sysfs tcl tcltk tcpd tetex theora threads tidy tiff tk truetype unicode usb v4l v4l2 vcd vhosts vim-syntax vorbis wifi win32codecs wmf wxwindows x264 x86 xattr xcb xcomposite xface xft xim xine xinerama xinetd xml xmlrpc xorg xosd xpm xscreensaver xulrunner xv xvid yahoo yaz zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 	emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m 	maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dumpio env expires ext_filter file_cache filter headers ident imagemap include info log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif speling status unique_id userdir usertrack version vhost_alias" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="evdev keyboard joystick mouse void wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev radeon v4l vga vesa"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Daniel Lin 2008-04-30 14:09:24 UTC
Created attachment 151421 [details]
strace of failing cp
Comment 2 Daniel Lin 2008-04-30 14:09:40 UTC
Created attachment 151422 [details]
strace of successful cp
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2008-04-30 16:01:38 UTC
While tmpfs does support POSIX ACLs, that support does not imply extended attributes support. For most file systems you will see the following:

CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y

However, as you've clearly shown, your tmpfs does not have the option to enabled extended attributes.

If you need this support, it's time to break out the text editor, compiler and subscribe to the LKML.
Comment 4 Daniel Lin 2008-04-30 17:19:12 UTC
USE=xattrs cp should not fail even if the filesystem it's running on does not support xattrs.  I noticed this because the kqemu build runs cp in the source tree, which fails and terminates compilation.

You're right, ACLs are unrelated.
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2008-04-30 18:27:58 UTC
I consider it a bug to silently ignore the fact that all data was not actually copied. The question is, what extended attributes do you have on those files?
Comment 6 Daniel Lin 2008-04-30 19:34:47 UTC
There are no extended attributes on those files whatsoever.  cp actually copies all the data over, it just tries to copy attributes before copying permissions, and falls over when the source filesystem returns EINVAL.
Comment 7 Daniel Lin 2008-04-30 19:37:01 UTC
Speaking of which, I've just noticed that mv suffers from the same problem (when it can't use rename()), and --attributes=- does not work as a workaround, since it doesn't understand that option.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2008-05-02 15:52:06 UTC
Thanks for reopening! Back to where we started... :)
Comment 9 SpanKY gentoo-dev 2008-05-05 03:43:32 UTC
we could always just drop the xattrs patch completely
Comment 10 SpanKY gentoo-dev 2009-02-22 00:13:34 UTC
should be fixed with coreutils-7.1