Skip to contentSkip to conversation

xfs compat_ioctl?

DISCUSSION Michael Tokarev 6 participants 14 messages Aug 31, 2009 – Sep 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello!

I tried to resize an xfs filesystem on 64bit 2.6.30 kernel using 32bit userland, and that does not work, in dmesg I see:

ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt

so apparently there's no compat_ioctl layer for these ioctls.

Are there any plans to add these? :)

Thanks!

/mjt

#1 lore raw
Quoted 11 lines · Michael Tokarev

Hello!

I tried to resize an xfs filesystem on 64bit 2.6.30 kernel using 32bit userland, and that does not work, in dmesg I see:

ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt

so apparently there's no compat_ioctl layer for these ioctls.

Are there any plans to add these? :)

Are you sure you're testing 2.6.30? The copat ioctls were added in 2.6.28.

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Michael Tokarev

Hello!

I tried to resize an xfs filesystem on 64bit 2.6.30 kernel using 32bit userland, and that does not work, in dmesg I see:

Quoted 8 lines
Quoted 6 lines

ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt

so apparently there's no compat_ioctl layer for these ioctls.

Are there any plans to add these? :)

Are you sure you're testing 2.6.30? The copat ioctls were added in 2.6.28.

..

What command-line flags were you using, Michael ?

I just tried a simple "xfs_growfs -d" here, and it worked fine. This is 2.6.31-rc7-64bit on top of a 32-bit userland.

Cheers

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 12 lines · Mark Lord
Quoted 11 lines · Christoph Hellwig
Quoted 10 lines · Michael Tokarev

Hello!

I tried to resize an xfs filesystem on 64bit 2.6.30 kernel using 32bit userland, and that does not work, in dmesg I see:

ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt

so apparently there's no compat_ioctl layer for these ioctls.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Are there any plans to add these? :)

Are you sure you're testing 2.6.30? The copat ioctls were added in 2.6.28.

What command-line flags were you using, Michael ?

I just tried a simple "xfs_growfs -d" here, and it worked fine. This is 2.6.31-rc7-64bit on top of a 32-bit userland.

Damn. I rebooted to 2.6.27 to test something unrelated, forgot about it, and later tried xfs_growfs -d, which failed as per above.

And yes indeed, in 2.6.30 everything works as expected.

Please excuse me for the noise.

/mjt

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Michael Tokarev

Hello!

I tried to resize an xfs filesystem on 64bit 2.6.30 kernel using 32bit userland, and that does not work, in dmesg I see:

ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt

Quoted 6 lines
Quoted 3 lines

so apparently there's no compat_ioctl layer for these ioctls.

Are there any plans to add these? :)

Are you sure you're testing 2.6.30? The copat ioctls were added in 2.6.28.

On a slightly related note: I also have a system with a 32bit userland and a 64bit kernel.
After switching to the 64bit kernel, xfs_fsr was no longer working, but that was caused by the then still missing compat ioctls.

Today I retried it, but it still fails:
XFS_IOC_SWAPEXT failed: ino=<number>: Invalid argument

Looking at the compat code SWAPEXT looks somewhat suspicious:

fs/xfs/linux-2.6/xfs_ioctl32.h defines XFS_IOC_SWAPEXT_32, but I can't find a single place where this is used.
And in the big switch of xfs_compat_ioctl() the value XFS_IOC_SWAPEXT is surrounded by contants that all end in 32.

I don't have any experience with the linux ioctl code, I only read fs/xfs/linux-2.6/xfs_ioctl32.c, but for my untrained eye it looks like there is a _32 missing.

Or am I misreading this completely?

Torsten

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw
Quoted 15 lines · Torsten Kaiser

On a slightly related note: I also have a system with a 32bit userland and a 64bit kernel.
After switching to the 64bit kernel, xfs_fsr was no longer working, but that was caused by the then still missing compat ioctls.

Today I retried it, but it still fails:
XFS_IOC_SWAPEXT failed: ino=<number>: Invalid argument

Looking at the compat code SWAPEXT looks somewhat suspicious:

fs/xfs/linux-2.6/xfs_ioctl32.h defines XFS_IOC_SWAPEXT_32, but I can't find a single place where this is used.
And in the big switch of xfs_compat_ioctl() the value XFS_IOC_SWAPEXT is surrounded by contants that all end in 32.

Quoted 5 lines

I don't have any experience with the linux ioctl code, I only read fs/xfs/linux-2.6/xfs_ioctl32.c, but for my untrained eye it looks like there is a _32 missing.

Or am I misreading this completely?

I think you are right, the constant used is incorrect. Does the small patch below fix it for you?

fs/xfs/linux-2.6/xfs_ioctl32.c +1 -1
Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================
@@ -619,7 +619,7 @@ xfs_file_compat_ioctl(
 	case XFS_IOC_GETVERSION_32:
 		cmd = _NATIVE_IOC(cmd, long);
 		return xfs_file_ioctl(filp, cmd, p);
-	case XFS_IOC_SWAPEXT: {
+	case XFS_IOC_SWAPEXT_32: {
 		struct xfs_swapext	  sxp;
 		struct compat_xfs_swapext __user *sxu = arg;
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw
Quoted 2 lines · Christoph Hellwig

I think you are right, the constant used is incorrect. Does the small patch below fix it for you?

Thanks, I will try it tomorrow.

Torsten

Quoted 14 lines

Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================

fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 renamed from fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 +1 -1
@@ -619,7 +619,7 @@ xfs_file_compat_ioctl(
       case XFS_IOC_GETVERSION_32:
               cmd = _NATIVE_IOC(cmd, long);
               return xfs_file_ioctl(filp, cmd, p);
-       case XFS_IOC_SWAPEXT: {
+       case XFS_IOC_SWAPEXT_32: {
               struct xfs_swapext        sxp;
               struct compat_xfs_swapext __user *sxu = arg;
 
#7 lore raw
In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

I think you are right, the constant used is incorrect. Does the small patch below fix it for you?

Yes, after adding this patch, xfs_fsr works.

Quoted 6 lines

Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================

fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 xfs_file_compat_ioctl( · line 625

Quoted 8 lines
fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 renamed from fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 +1 -1
@@ -619,7 +619,7 @@ xfs_file_compat_ioctl(
       case XFS_IOC_GETVERSION_32:
               cmd = _NATIVE_IOC(cmd, long);
               return xfs_file_ioctl(filp, cmd, p);
-       case XFS_IOC_SWAPEXT: {
+       case XFS_IOC_SWAPEXT_32: {
               struct xfs_swapext        sxp;
               struct compat_xfs_swapext __user *sxu = arg;
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw
Quoted 5 lines · Torsten Kaiser
Quoted 2 lines · Christoph Hellwig

I think you are right, the constant used is incorrect. Does the small patch below fix it for you?

Yes, after adding this patch, xfs_fsr works.

Crud, sorry about that. I swear I ran 32-bit xfstests under a 64-bit kernel, but I think we were lacking in fsr coverage....

-Eric

Quoted 11 lines
Quoted 11 lines

Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================

fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 renamed from fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 +1 -1
@@ -619,7 +619,7 @@ xfs_file_compat_ioctl(
       case XFS_IOC_GETVERSION_32:
               cmd = _NATIVE_IOC(cmd, long);
               return xfs_file_ioctl(filp, cmd, p);
-       case XFS_IOC_SWAPEXT: {
+       case XFS_IOC_SWAPEXT_32: {
               struct xfs_swapext        sxp;
Quoted 9 lines

fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 xfs_file_compat_ioctl( · line 625

Quoted 3 lines
fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:10.856544216 -0300 renamed from fs/xfs/linux-2.6/xfs_ioctl32.c 2009-08-31 15:25:06.093044591 -0300 +0 -0
               struct compat_xfs_swapext __user *sxu = arg;
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#9 lore raw
In reply to Christoph Hellwig

I still get these on 2.6.30.4 on sparc64 (32-bit userspace a la Debian etch):

sparcy:~# uname -a
Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc64 GNU/Linux
sparcy:~# file $(which xfs_fsr)
/usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
sparcy:~# dmesg | grep xfs | tail -5
[62457.467755] ioctl32(xfs_fsr:18816): Unknown cmd fd(7) cmd(c0a8586d){t:'X';sz:168} arg(00028e30) on /export
[62473.400273] ioctl32(xfs_fsr:18816): Unknown cmd fd(7) cmd(c0a8586d){t:'X';sz:168} arg(00028e30) on /export
[62481.928844] ioctl32(xfs_fsr:18816): Unknown cmd fd(7) cmd(c0a8586d){t:'X';sz:168} arg(00028e30) on /export
[62486.304567] ioctl32(xfs_fsr:18816): Unknown cmd fd(7) cmd(c0a8586d){t:'X';sz:168} arg(00028e30) on /export
[62490.833736] ioctl32(xfs_fsr:18816): Unknown cmd fd(7) cmd(c0a8586d){t:'X';sz:168} arg(00028e30) on /export

Haven't tried rolling my own xfs_progs binaries yet. xfs_db also fails with a "Bus error" immediately on startup, but that may be a completely different issue...

tw

Quoted 13 lines · Christoph Hellwig
Quoted 13 lines · Michael Tokarev
	> Hello!
	>
	> I tried to resize an xfs filesystem on 64bit 2.6.30 kernel
	> using 32bit userland, and that does not work, in dmesg I see:
	>
	> ioctl32(xfs_growfs:24426): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ffa56df4) on /mnt
	> ioctl32(xfs_growfs:24427): Unknown cmd fd(3) cmd(400c586e){t:'X';sz:12} arg(ff991254) on /mnt
	>
	> so apparently there's no compat_ioctl layer for these ioctls.
	>
	> Are there any plans to add these? :)
Quoted 7 lines
Quoted 7 lines

Are you sure you're testing 2.6.30? The copat ioctls were added in 2.6.28.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

End of included message

Signature · 6 lines
+----------------------+
| Tim Walberg          |
| 830 Carriage Dr.     |
| Algonquin, IL 60102  |
| [email protected] |
+----------------------+

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#10 lore raw
Quoted 3 lines · Tim Walberg

Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc64 GNU/Linux

sparcy:~# file $(which xfs_fsr)
/usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

I'll take a look at that, thanks.

Quoted 3 lines

Haven't tried rolling my own xfs_progs binaries yet. xfs_db also fails with a "Bus error" immediately on startup, but that may be a completely different issue...

It's a problem with unaligned accesses which I fixed for xfsprogs-2.0.3 which was released yesterday.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#11 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Tim Walberg

Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc64 GNU/Linux

sparcy:~# file $(which xfs_fsr)
/usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

I'll take a look at that, thanks.

Err, sorry - is that with the patch I posted in this thread or without?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#12 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 9 lines · Christoph Hellwig
	> On Mon, Aug 31, 2009 at 01:37:51PM -0500, Tim Walberg wrote:
	> > Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc64 GNU/Linux
	> > sparcy:~# file $(which xfs_fsr)
	> > /usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
	> 
	> I'll take a look at that, thanks.
	
	Err, sorry - is that with the patch I posted in this thread or without?

End of included message

No, that's the generic 2.6.30.4... I can attempt with that patch as well, but it might be a day or two...

tw

Signature · 6 lines
+----------------------+
| Tim Walberg          |
| 830 Carriage Dr.     |
| Algonquin, IL 60102  |
| [email protected] |
+----------------------+

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#13 lore raw

Ok, that patch has fixed my issues with xfs_fsr. Now I just need to pull a new copy of xfs_progs to get the xfs_db alignment issue fix...

Thanks,
tw

Quoted 15 lines · Tim
Quoted 15 lines · Christoph Hellwig
	>>	On Mon, Aug 31, 2009 at 02:48:22PM -0400, Christoph Hellwig wrote:
	>>	> On Mon, Aug 31, 2009 at 01:37:51PM -0500, Tim Walberg wrote:
	>>	> > Linux sparcy 2.6.30.4-sparcy #2 Sat Aug 1 21:14:46 CDT 2009 sparc64 GNU/Linux
	>>	> > sparcy:~# file $(which xfs_fsr)
	>>	> > /usr/sbin/xfs_fsr: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
	>>	> 
	>>	> I'll take a look at that, thanks.
	>>	
	>>	Err, sorry - is that with the patch I posted in this thread or without?
	End of included message
Quoted 5 lines
Quoted 5 lines

No, that's the generic 2.6.30.4... I can attempt with that patch as well, but it might be a day or two...

tw

End of included message

Signature · 1 line
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs