[Bug 818373] New: chattr cannot add compression flags (+c) to some files on btrfs
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c0 Summary: chattr cannot add compression flags (+c) to some files on btrfs Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: x86-64 OS/Version: openSUSE 12.3 Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: hartrumpf@gmx.net QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 If I try to set the compression flag (+c) on many files (with or without using -R), chattr will fail for some files. I have no clue why it fails on some files and why it succeeds on others. The filesystem is btrfs, with mount options rw,noatime,compress=lzo,space_cache. Reproducible: Always Steps to Reproduce:
cd /your-btrfs-dir-with-mount-option-compresslzo cp -a /usr/bin . cd bin find . -type l | xargs rm chattr -R +c .
Actual Results: chattr: Invalid argument while setting flags on ./speech-dispatcher chattr: Invalid argument while setting flags on ./mysqldumpslow chattr: Invalid argument while setting flags on ./gnome-session chattr: Invalid argument while setting flags on ./autoexpect chattr: Invalid argument while setting flags on ./grops chattr: Invalid argument while setting flags on ./mysqldump chattr: Invalid argument while setting flags on ./myisampack chattr: Invalid argument while setting flags on ./resolveip chattr: Invalid argument while setting flags on ./tomahawk chattr: Invalid argument while setting flags on ./resolve_stack_dump chattr: Invalid argument while setting flags on ./bibtexu chattr: Invalid argument while setting flags on ./smidump chattr: Invalid argument while setting flags on ./qt3to4 chattr: Invalid argument while setting flags on ./my_print_defaults chattr: Invalid argument while setting flags on ./tzselect chattr: Invalid argument while setting flags on ./systemctl chattr: Invalid argument while setting flags on ./piconv chattr: Invalid argument while setting flags on ./mysqladmin chattr: Invalid argument while setting flags on ./mysqlcheck chattr: Invalid argument while setting flags on ./teckit_compile chattr: Invalid argument while setting flags on ./psmandup chattr: Invalid argument while setting flags on ./dislocate chattr: Invalid argument while setting flags on ./bashbug chattr: Invalid argument while setting flags on ./htdig chattr: Invalid argument while setting flags on ./card chattr: Invalid argument while setting flags on ./mysqlimport chattr: Invalid argument while setting flags on ./w3m chattr: Invalid argument while setting flags on ./xml_pp chattr: Invalid argument while setting flags on ./myisamchk chattr: Invalid argument while setting flags on ./transmission-gtk chattr: Invalid argument while setting flags on ./gkrellm chattr: Invalid argument while setting flags on ./inkscape chattr: Invalid argument while setting flags on ./myisam_ftdump chattr: Invalid argument while setting flags on ./mysqlshow chattr: Invalid argument while setting flags on ./xetex chattr: Invalid argument while setting flags on ./showaudio chattr: Invalid argument while setting flags on ./guess_encoding chattr: Invalid argument while setting flags on ./qvfb chattr: Invalid argument while setting flags on ./luatex chattr: Invalid argument while setting flags on ./uum chattr: Invalid argument while setting flags on ./config_data chattr: Invalid argument while setting flags on ./mkinfodir Expected Results: No output (and the c attribute should be set for all specified files). same on openSUSE 12.2 (last tested some months ago) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c FeiXiang Zhang <fxzhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dsterba@suse.com AssignedTo|bnc-team-screening@forge.pr |jack@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c1 Jan Kara <jack@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jack@suse.com AssignedTo|jack@suse.com |dsterba@suse.com --- Comment #1 from Jan Kara <jack@suse.com> 2013-05-06 13:07:07 UTC --- I guess this is more for David than for me - it looks like btrfs specific issue... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c2 Carlos Robinson <carlos.e.r@opensuse.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carlos.e.r@opensuse.org --- Comment #2 from Carlos Robinson <carlos.e.r@opensuse.org> 2013-05-06 16:16:49 UTC --- Trying to replicate the problem, I did a quick test on a test partition of mine (12.3 VM). I get that error on symlinks, normal files are accepted. I have not checked the above list, dunno if they are files or symlinks. I pointed this to the OP in the forum where he asked first, but got no response from him - so I take the liberty of writing this note here just in case. I must mention that I have no idea how compression should work or not in btrfs, so I may be wrong. Please note that, due to Bug 818001, I'm not getting any emails from Bugzilla. Thus if you want to communicate with me, please write your comment on Bugzilla, then email me directly - the address is visible to you on the top. Otherwise I may not even notice there is a response here. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c3 Sven Hartrumpf <hartrumpf@gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hartrumpf@gmx.net --- Comment #3 from Sven Hartrumpf <hartrumpf@gmx.net> 2013-05-06 17:58:51 UTC --- (In reply to comment #2)
Trying to replicate the problem, I did a quick test on a test partition of mine (12.3 VM). I get that error on symlinks, normal files are accepted.
The files that cause errors are not soft links. (I removed them, see the "find" command above.) In a separate test set, 2467 of 277000 text files failed.
I pointed this to the OP in the forum where he asked first, but got no response from him
Now answered, forum software did not email me:-( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c Alberto Planas Dominguez <aplanas@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| | GOLD -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c4 --- Comment #4 from Sven Hartrumpf <hartrumpf@gmx.net> 2014-03-06 11:43:30 UTC --- Just to share some more information: This bug also affects openSUSE 13.1 and Kernel:Stable (3.13.5-1.g4e9ddcc-default). Should I open a new bug against openSUSE 13.1? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c5 --- Comment #5 from David Sterba <dsterba@suse.com> 2014-03-21 17:40:24 CET --- Probably found out why: the files are not compressible with lzo and automatically get the NOCOMPRESS bit set. Combining +c with NOCOMPRESS is invalid, thus the error, though I can't find exactly where it fails. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c6 Filipe Manana <fdmanana@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fdmanana@suse.com --- Comment #6 from Filipe Manana <fdmanana@suse.com> 2014-08-13 18:28:08 UTC --- This fails because chattr +c calls the getflags ioctl to get the current flags, which include FS_NOCOMP_FL because the file isn't compressible as David said, and adds the requested flags (+c) to the flags it got. Finally it calls the setflags ioctl with flags == (FS_NOCOMP_FL | FS_COMPR_FL). The btrfs ioctl returns with EINVAL in ioctl.c:check_flags(): if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL)) return -EINVAL; If you try calling chattr =c instead, it won't OR the current flags with the requested flags, and whence no error returned. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c7 --- Comment #7 from Filipe Manana <fdmanana@suse.com> 2014-08-13 18:47:36 UTC --- Another note, lsattr doesn't list the FS_NOCOMP_FL flag, despite getting it returned from the getflags ioctl. I modified e2fsprogs source, misc/chattr.c and misc/lsattr.c to printf the flags after calling the getflags ioctl in hex form: root 20:43:38 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/lsattr ./bin/sbigtopgm ioctl flags: 400 ---------------- ./bin/sbigtopgm root 20:43:47 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/chattr +c ./bin/sbigtopgm ioctl flags: 400 /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/chattr: Invalid argument while setting flags on ./bin/sbigtopgm root 20:44:03 /mnt/sdd > root 20:44:06 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/chattr =c ./bin/sbigtopgm ioctl flags: 400 root 20:44:10 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/lsattr ./bin/sbigtopgm ioctl flags: 4 --------c------- ./bin/sbigtopgm root 20:44:13 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/chattr -c ./bin/sbigtopgm ioctl flags: 4 root 20:44:26 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/lsattr ./bin/sbigtopgm ioctl flags: 0 ---------------- ./bin/sbigtopgm root 20:44:30 /mnt/sdd > -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c8 --- Comment #8 from Filipe Manana <fdmanana@suse.com> 2014-08-13 19:51:09 UTC --- One last finding... So it turns out lsattr can show the FS_NOCOMP_FL flag, with the letter 'X' representing it, if and only if e2fsprogs was built with compression enabled (i.e. ./configure --enable-compression), in which case we get something like this: root 21:21:08 /mnt/sdd > /home/fdmanana/tmp/e2/e2fsprogs-1.42.11/misc/lsattr -v ./bin/ipod-time-sync AQUI flags: 400 6 -----------X-------- ./bin/ipod-time-sync root 21:21:19 /mnt/sdd > But the flag FS_COMPR_FL is always displayed if set, regardless of building with --enable-compression or not. Equally confusing, is the long name of the the FS_NOCOMP_FL flag: http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/tree/lib/e2p/pf.c#n30 "Compression_Raw_Access" not something like "compression disabled" for example. To note as well that using --enable-compression causes the build to emit several warnings telling that compression support is experimental, probably why most distros at least don't seem to build with it (even thought this experimental status applies to extN only). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c9 --- Comment #9 from Jan Kara <jack@suse.com> 2014-08-14 14:50:58 UTC --- Felipe, extN compression support doesn't really exist (anymore) so feel free to change how lsattr, chattr, setattr handles compression flag to make sense for btrfs and submit patches upstream (linux-ext4@vger.kernel.org, tytso@mit.edu). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=818373 https://bugzilla.novell.com/show_bug.cgi?id=818373#c10 --- Comment #10 from Filipe Manana <fdmanana@suse.com> 2014-08-14 15:04:14 UTC --- Thanks Jan. Jeff has a patch that updates the documentation and makes lsattr show X (FS_NOCOMP_FL) regardless of building with or without --enable-compression. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com