linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* filefrag abort
@ 2009-07-20 21:49 Ron Johnson
  2009-07-20 22:16 ` Eric Sandeen
  2009-07-21  2:03 ` Theodore Tso
  0 siblings, 2 replies; 12+ messages in thread
From: Ron Johnson @ 2009-07-20 21:49 UTC (permalink / raw)
  To: linux-ext4

Hi,

(Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052 
doesn't show much activity...)

Debian Sid, e2fsprogs 1.41.8-1
Home-rolled 64-bit 2.6.30 with 32-bit userland

Is this ioctl32() error caused by a "disconnect" between kernel and 
userland?

Thanks

$ df -T /
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sdb2     ext3    34606072   8585632  24262528  27% /

# filefrag -v /bin/cp
Filesystem type is: ef53
Filesystem cylinder groups is approximately 265
File size of /bin/cp is 92476 (23 blocks, blocksize 4096)
  ext logical physical expected length flags
Calling get_bmap for block 0
Aborted

[92747.137445] ioctl32(filefrag:17217): Unknown cmd fd(3) 
cmd(c020660b){t:'f';sz:32} arg(ffca4c38) on /bin/cp

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: filefrag abort
  2009-07-20 21:49 filefrag abort Ron Johnson
@ 2009-07-20 22:16 ` Eric Sandeen
  2009-07-21  2:03 ` Theodore Tso
  1 sibling, 0 replies; 12+ messages in thread
From: Eric Sandeen @ 2009-07-20 22:16 UTC (permalink / raw)
  To: Ron Johnson; +Cc: linux-ext4

Ron Johnson wrote:
> Hi,
> 
> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052 
> doesn't show much activity...)
> 
> Debian Sid, e2fsprogs 1.41.8-1
> Home-rolled 64-bit 2.6.30 with 32-bit userland
> 
> Is this ioctl32() error caused by a "disconnect" between kernel and 
> userland?
> 
> Thanks
> 
> $ df -T /
> Filesystem    Type   1K-blocks      Used Available Use% Mounted on
> /dev/sdb2     ext3    34606072   8585632  24262528  27% /
> 
> # filefrag -v /bin/cp
> Filesystem type is: ef53
> Filesystem cylinder groups is approximately 265
> File size of /bin/cp is 92476 (23 blocks, blocksize 4096)
>   ext logical physical expected length flags
> Calling get_bmap for block 0
> Aborted
> 
> [92747.137445] ioctl32(filefrag:17217): Unknown cmd fd(3) 
> cmd(c020660b){t:'f';sz:32} arg(ffca4c38) on /bin/cp

It's a bug, I sent a patch...

http://marc.info/?l=linux-ext4&m=124768937928420&w=2

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: filefrag abort
  2009-07-20 21:49 filefrag abort Ron Johnson
  2009-07-20 22:16 ` Eric Sandeen
@ 2009-07-21  2:03 ` Theodore Tso
  2009-07-22  0:33   ` ioctl32 (was Re: filefrag abort) Ron Johnson
  1 sibling, 1 reply; 12+ messages in thread
From: Theodore Tso @ 2009-07-21  2:03 UTC (permalink / raw)
  To: Ron Johnson; +Cc: linux-ext4

On Mon, Jul 20, 2009 at 04:49:04PM -0500, Ron Johnson wrote:
> Hi,
>
> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052  
> doesn't show much activity...)
>
> Debian Sid, e2fsprogs 1.41.8-1
> Home-rolled 64-bit 2.6.30 with 32-bit userland

Should be fixed in e2fsprogs 1.41.8-2

						- Ted

^ permalink raw reply	[flat|nested] 12+ messages in thread

* ioctl32 (was Re: filefrag abort)
  2009-07-21  2:03 ` Theodore Tso
@ 2009-07-22  0:33   ` Ron Johnson
  2009-07-22  0:57     ` Eric Sandeen
  0 siblings, 1 reply; 12+ messages in thread
From: Ron Johnson @ 2009-07-22  0:33 UTC (permalink / raw)
  To: linux-ext4

On 2009-07-20 21:03, Theodore Tso wrote:
> On Mon, Jul 20, 2009 at 04:49:04PM -0500, Ron Johnson wrote:
>> Hi,
>>
>> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052  
>> doesn't show much activity...)
>>
>> Debian Sid, e2fsprogs 1.41.8-1
>> Home-rolled 64-bit 2.6.30 with 32-bit userland
> 
> Should be fixed in e2fsprogs 1.41.8-2

ff seems to work now, but I still get this in dmesg:

[188883.274547] ioctl32(filefrag:7086): Unknown cmd fd(3) 
cmd(c020660b){t:'f';sz:32} arg(ffacb808) on /some/large/file

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32 (was Re: filefrag abort)
  2009-07-22  0:33   ` ioctl32 (was Re: filefrag abort) Ron Johnson
@ 2009-07-22  0:57     ` Eric Sandeen
  2009-07-22 17:01       ` Andreas Dilger
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Sandeen @ 2009-07-22  0:57 UTC (permalink / raw)
  To: Ron Johnson; +Cc: linux-ext4

Ron Johnson wrote:
> On 2009-07-20 21:03, Theodore Tso wrote:
>> On Mon, Jul 20, 2009 at 04:49:04PM -0500, Ron Johnson wrote:
>>> Hi,
>>>
>>> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052  
>>> doesn't show much activity...)
>>>
>>> Debian Sid, e2fsprogs 1.41.8-1
>>> Home-rolled 64-bit 2.6.30 with 32-bit userland
>> Should be fixed in e2fsprogs 1.41.8-2
> 
> ff seems to work now, but I still get this in dmesg:
> 
> [188883.274547] ioctl32(filefrag:7086): Unknown cmd fd(3) 
> cmd(c020660b){t:'f';sz:32} arg(ffacb808) on /some/large/file
> 

Huh, did we miss a compat ioctl for fiemap.... looks like so.  I'll look
into that tomorrow, thanks.

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32 (was Re: filefrag abort)
  2009-07-22  0:57     ` Eric Sandeen
@ 2009-07-22 17:01       ` Andreas Dilger
  2009-07-23  4:51         ` Eric Sandeen
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Dilger @ 2009-07-22 17:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Ron Johnson, linux-ext4

On Jul 21, 2009  19:57 -0500, Eric Sandeen wrote:
> Ron Johnson wrote:
> > On 2009-07-20 21:03, Theodore Tso wrote:
> >> On Mon, Jul 20, 2009 at 04:49:04PM -0500, Ron Johnson wrote:
> >>> Hi,
> >>>
> >>> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052  
> >>> doesn't show much activity...)
> >>>
> >>> Debian Sid, e2fsprogs 1.41.8-1
> >>> Home-rolled 64-bit 2.6.30 with 32-bit userland
> >> Should be fixed in e2fsprogs 1.41.8-2
> > 
> > ff seems to work now, but I still get this in dmesg:
> > 
> > [188883.274547] ioctl32(filefrag:7086): Unknown cmd fd(3) 
> > cmd(c020660b){t:'f';sz:32} arg(ffacb808) on /some/large/file
> 
> Huh, did we miss a compat ioctl for fiemap.... looks like so.  I'll look
> into that tomorrow, thanks.

Sigh, I wish there was some sort of automatic ioctl parser tool that
would report if the ioctl will need compat handling or not.  I thought
the fiemap structs didn't need any compat handling because they are
properly sized/aligned and w/o pointers...

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32 (was Re: filefrag abort)
  2009-07-22 17:01       ` Andreas Dilger
@ 2009-07-23  4:51         ` Eric Sandeen
  2009-07-24  0:34           ` Ron Johnson
  2009-07-24 16:26           ` ioctl32 Andi Kleen
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Sandeen @ 2009-07-23  4:51 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Ron Johnson, linux-ext4

Andreas Dilger wrote:
> On Jul 21, 2009  19:57 -0500, Eric Sandeen wrote:
>> Ron Johnson wrote:
>>> On 2009-07-20 21:03, Theodore Tso wrote:
>>>> On Mon, Jul 20, 2009 at 04:49:04PM -0500, Ron Johnson wrote:
>>>>> Hi,
>>>>>
>>>>> (Is this OT?  http://sourceforge.net/forum/forum.php?forum_id=7052  
>>>>> doesn't show much activity...)
>>>>>
>>>>> Debian Sid, e2fsprogs 1.41.8-1
>>>>> Home-rolled 64-bit 2.6.30 with 32-bit userland
>>>> Should be fixed in e2fsprogs 1.41.8-2
>>> ff seems to work now, but I still get this in dmesg:
>>>
>>> [188883.274547] ioctl32(filefrag:7086): Unknown cmd fd(3) 
>>> cmd(c020660b){t:'f';sz:32} arg(ffacb808) on /some/large/file
>> Huh, did we miss a compat ioctl for fiemap.... looks like so.  I'll look
>> into that tomorrow, thanks.
> 
> Sigh, I wish there was some sort of automatic ioctl parser tool that
> would report if the ioctl will need compat handling or not.  I thought
> the fiemap structs didn't need any compat handling because they are
> properly sized/aligned and w/o pointers...

They are properly sized yep but I think they still have to be flagged:

/* pointer to compatible structure or no argument */
#define COMPATIBLE_IOCTL(cmd) \
        { (cmd), do_ioctl32_pointer },

I have to remind myself how this all works, despite doing a bunch of
ioctl32 work for xfs last year :)

I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
should be enough, I'll try to get it tested tomorrow.

-Eric

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32 (was Re: filefrag abort)
  2009-07-23  4:51         ` Eric Sandeen
@ 2009-07-24  0:34           ` Ron Johnson
  2009-07-24  2:38             ` Eric Sandeen
  2009-07-24 16:26           ` ioctl32 Andi Kleen
  1 sibling, 1 reply; 12+ messages in thread
From: Ron Johnson @ 2009-07-24  0:34 UTC (permalink / raw)
  To: linux-ext4

On 2009-07-22 23:51, Eric Sandeen wrote:
[snip]
> 
> I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
> should be enough, I'll try to get it tested tomorrow.

If the tarball/git tree can be installed under /usr/local, I'd be 
glad to test it too.

-- 
Scooty Puff, Sr
The Doom-Bringer

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32 (was Re: filefrag abort)
  2009-07-24  0:34           ` Ron Johnson
@ 2009-07-24  2:38             ` Eric Sandeen
  0 siblings, 0 replies; 12+ messages in thread
From: Eric Sandeen @ 2009-07-24  2:38 UTC (permalink / raw)
  To: Ron Johnson; +Cc: linux-ext4

Ron Johnson wrote:
> On 2009-07-22 23:51, Eric Sandeen wrote:
> [snip]
>> I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
>> should be enough, I'll try to get it tested tomorrow.
> 
> If the tarball/git tree can be installed under /usr/local, I'd be 
> glad to test it too.
> 

It'd be a kernel patch, not userspace.

And sorry, didn't get to it today....

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32
  2009-07-23  4:51         ` Eric Sandeen
  2009-07-24  0:34           ` Ron Johnson
@ 2009-07-24 16:26           ` Andi Kleen
  2009-07-24 16:28             ` ioctl32 Eric Sandeen
  2009-07-25 14:46             ` ioctl32 Christoph Hellwig
  1 sibling, 2 replies; 12+ messages in thread
From: Andi Kleen @ 2009-07-24 16:26 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Andreas Dilger, Ron Johnson, linux-ext4

Eric Sandeen <sandeen@redhat.com> writes:
>
> /* pointer to compatible structure or no argument */
> #define COMPATIBLE_IOCTL(cmd) \
>         { (cmd), do_ioctl32_pointer },


The modern way to do this is to use the ->compat_ioctl VFS
method. COMPATIBLE_IOCTL etc are all obsolete.

> I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
> should be enough, I'll try to get it tested tomorrow.

Nope, add a ->compat_ioctl 

When your ioctl is already a unlocked_ioctl you can just use
the same function. If not convert to unlocked_ioctl first.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32
  2009-07-24 16:26           ` ioctl32 Andi Kleen
@ 2009-07-24 16:28             ` Eric Sandeen
  2009-07-25 14:46             ` ioctl32 Christoph Hellwig
  1 sibling, 0 replies; 12+ messages in thread
From: Eric Sandeen @ 2009-07-24 16:28 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andreas Dilger, Ron Johnson, linux-ext4

Andi Kleen wrote:
> Eric Sandeen <sandeen@redhat.com> writes:
>> /* pointer to compatible structure or no argument */
>> #define COMPATIBLE_IOCTL(cmd) \
>>         { (cmd), do_ioctl32_pointer },
> 
> 
> The modern way to do this is to use the ->compat_ioctl VFS
> method. COMPATIBLE_IOCTL etc are all obsolete.
> 
>> I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
>> should be enough, I'll try to get it tested tomorrow.
> 
> Nope, add a ->compat_ioctl 
> 
> When your ioctl is already a unlocked_ioctl you can just use
> the same function. If not convert to unlocked_ioctl first.
> 
> -Andi

Ok thanks, I knew I needed to revisit it.  ;)

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: ioctl32
  2009-07-24 16:26           ` ioctl32 Andi Kleen
  2009-07-24 16:28             ` ioctl32 Eric Sandeen
@ 2009-07-25 14:46             ` Christoph Hellwig
  1 sibling, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2009-07-25 14:46 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Eric Sandeen, Andreas Dilger, Ron Johnson, linux-ext4

On Fri, Jul 24, 2009 at 06:26:56PM +0200, Andi Kleen wrote:
> > /* pointer to compatible structure or no argument */
> > #define COMPATIBLE_IOCTL(cmd) \
> >         { (cmd), do_ioctl32_pointer },
> 
> 
> The modern way to do this is to use the ->compat_ioctl VFS
> method. COMPATIBLE_IOCTL etc are all obsolete.
> 
> > I think adding COMPATIBLE_IOCTL(FS_IOC_FIEMAP); to fs/compat_ioctl.c
> > should be enough, I'll try to get it tested tomorrow.
> 
> Nope, add a ->compat_ioctl 
> 
> When your ioctl is already a unlocked_ioctl you can just use
> the same function. If not convert to unlocked_ioctl first.

fiemap is handled in generic code and never enters ->whatever_ioctl.
Because of that there are only two ways to handle it:

  (1) add it to the static translation table in fs/compat_ioctl.c
  (2) add a special case to compat_sys_ioctl

Number one is the much simpler solution for a fully compatible ioctl.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-07-25 14:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 21:49 filefrag abort Ron Johnson
2009-07-20 22:16 ` Eric Sandeen
2009-07-21  2:03 ` Theodore Tso
2009-07-22  0:33   ` ioctl32 (was Re: filefrag abort) Ron Johnson
2009-07-22  0:57     ` Eric Sandeen
2009-07-22 17:01       ` Andreas Dilger
2009-07-23  4:51         ` Eric Sandeen
2009-07-24  0:34           ` Ron Johnson
2009-07-24  2:38             ` Eric Sandeen
2009-07-24 16:26           ` ioctl32 Andi Kleen
2009-07-24 16:28             ` ioctl32 Eric Sandeen
2009-07-25 14:46             ` ioctl32 Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).