Description of problem: $ touch doesnotwork $ lsattr doesnotwork ioctl(3, EXT2_IOC_GETFLAGS, 0xffbe2888) = -1 EINVAL (Invalid argument) $ df -Th . Filesystem Type Size Used Avail Use% Mounted on /dev/sda6 xfs 28G 15G 14G 51% / (Please change Component if the bug is really in kernel or xfs or ...) Version-Release number of selected component (if applicable): 1.40.2-5 How reproducible: always Steps to Reproduce: 1. run 32bit binary of lsattr/chattr on x86_64 kernel 2. 3. Actual results: EINVAL also, for chattr +i: 2007-09-15 13:21:26.890857757 <4>[234912.043934] ioctl32(chattr:4922): Unknown cmd fd(3) cmd(80046601){t:'f';sz:4} arg(fff4d6c8) on /var/log/qmail/smtpd/old/@4000000040dc8884213ed37c.s.gz Expected results: as documented in man pages Additional info:
This works for me: [root@inode tmp]# ./chattr32 +i file [root@inode tmp]# file chattr32 chattr32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped [root@inode tmp]# ./lsattr32 file ----i--------- file [root@inode tmp]# file lsattr32 lsattr32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped [root@inode tmp]# uname -a Linux inode.lab.msp.redhat.com 2.6.23-0.184.rc6.git4.fc8 #1 SMP Fri Sep 14 17:11:26 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux those two binaries were built from e2fsprogs-1.40.2-5 on a 32-bit box, and rsynced to the x86_64 box. What kernel version are you using?
/usr/bin/lsattr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped Linux safari.finland.fbi 2.6.22.6-cfs-v20.5-64 #2 SMP Wed Sep 12 19:00:17 EEST 2007 x86_64 x86_64 x86_64 GNU/Linux
> Linux safari.finland.fbi 2.6.22.6-cfs-v20.5-64 #2 SMP Wed Sep 12 19:00:17 EEST 2007 x86_64 x86_64 x86_64 GNU/Linux That's not a fedora kernel. If you can reproduce this on a fedora kernel, please re-open. This is most likely a kernel problem, and you're not running a fedora kernel. Thanks, -Eric
Whoops, just realized you were trying this on xfs. Sorry. It is broken there. This should be working... I'll look into it. -Eric
Created attachment 196721 [details] patch to test This should fix it. Care to test it, if you can rebuild xfs? I'll send this to sgi. -Eric
Thanks. Fix looks straightforward, other fs'es are also using FS_IOC32_GETFLAGS... I can rebuild+reboot inside a couple of days. This is not the only thing broken on XFS with 32bit compat. For example: # xfs_io -r -p xfs_bmap -c "bmap -v" /tmp/jee.txt xfs_bmap: can't get geometry ["/tmp/jee.txt"]: Invalid argument # /rh/BUILD/xfsprogs-2.9.4/io/xfs_io -r -p xfs_bmap -c "bmap -v" /tmp/jee.txt /tmp/jee.txt: EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL 0: [0..719]: 24530448..24531167 10 (101648..102367) 720
Yep... we've never had all of the xfs ioctls working, though at least some were... and I thought lsattr was too. I'm not sure if something broke... I'll take a look when I get a chance. Don't sweat the test if you don't want to or can't, but the patch is there if you want it. I'll take a look at the rest of this and send a patch upstream. Thanks, -Eric
Actually, what kernel message did you get out of the bmap command? this one actually does seem to be working for me :) and I don't see any obvious size or alignment problems in struct getbmap... -Eric
bmap did not produce any kernel messages.
very strange that bmap gives no messages. Maybe strace? Honestly, it does work for me here. :) Patch for GETXFLAGS, SETXFLAGS, and GETVERSION sent upstream: http://oss.sgi.com/archives/xfs/2007-09/msg00174.html When they ack and/or commit it, I can put it into the fedora kernel until it comes back via kernel.org. Thanks, -Eric
strace is useless 20:03:14.953872 ioctl(3, 0x806c5864, 0xffcfbf88) = -1 EINVAL (Invalid argument) <0.000014> 32bit version works with xfs_io -r -p xfs_bmap -c "bmap" /tmp/jee.txt but not with xfs_io -r -p xfs_bmap -c "bmap -v" /tmp/jee.txt Nice that you sent the patch, but you forgot to tell who found the bug.
Sorry 'bout that. Will follow up.
Dunno... [root@inode sbin]# ./xfs_io -r -p xfs_bmap -c "bmap -v" /obj/e2fsprogs-1.35.tar.gz /obj/e2fsprogs-1.35.tar.gz: EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS 0: [0..6159]: 18461096..18467255 0 (18461096..18467255) 6160 01111 [root@inode sbin]# file xfs_io xfs_io: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped [root@inode sbin]# uname -a Linux inode.lab.msp.redhat.com 2.6.23-rc1-git3 #7 SMP Fri Sep 7 16:51:19 CDT 2007 x86_64 x86_64 x86_64 GNU/Linux
modified rawhide kernel, building now.