linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH] contort getdents64 to pacify gcc-2.96
@ 2005-01-13  6:34 Meda, Prasanna
  0 siblings, 0 replies; 3+ messages in thread
From: Meda, Prasanna @ 2005-01-13  6:34 UTC (permalink / raw)
  To: Linus Torvalds, Adam Kropelin; +Cc: Andrew Morton, linux-kernel



On Thu, 13 Jan 2005, Linus Torvalds Wrote:

> On Thu, 13 Jan 2005, Adam Kropelin wrote:
> > 
> > ...gives gcc-2.96 indigestion:
>
> Ouch. I wonder what triggers it. But your patch looks fine, so let's just 
> roll with it.

Wierd, It was also okay with 2.95.

Looks like readdir.c had same problems earlier. The post at
http://www.cs.helsinki.fi/linux/linux-kernel/2003-06/0362.html

suggested to change the __put_user to put_user.

Thanks,
Prasanna.

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

* [PATCH] contort getdents64 to pacify gcc-2.96
  2005-01-12  5:09 Linux 2.6.11-rc1 Linus Torvalds
@ 2005-01-13  5:42 ` Adam Kropelin
  2005-01-13  3:51   ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Kropelin @ 2005-01-13  5:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Prasanna Meda, Andrew Morton, linux-kernel

A recent trivial fixup in sys_getdents64...

> diff -Nru a/fs/readdir.c b/fs/readdir.c
> --- a/fs/readdir.c	2005-01-12 19:22:35 -08:00
> +++ b/fs/readdir.c	2005-01-12 19:22:35 -08:00
> @@ -287,8 +287,9 @@
>  	lastdirent = buf.previous;
>  	if (lastdirent) {
>  		typeof(lastdirent->d_off) d_off = file->f_pos;
> -		__put_user(d_off, &lastdirent->d_off);
>  		error = count - buf.count;
> +		if (__put_user(d_off, &lastdirent->d_off))
> +			error = -EFAULT;
>  	}
>  
>  out_putf:

...gives gcc-2.96 indigestion:

> fs/readdir.c: In function `sys_getdents64':
> fs/readdir.c:299: Unrecognizable insn:
> (insn 166 257 174 (parallel[
>             (set (reg/v:SI 6 ebp)
>                 (asm_operands/v ("1:    movl %%eax,0(%2)
> 2:      movl %%edx,4(%2)
> 3:
> .section .fixup,"ax"
> 4:      movl %3,%0
>         jmp 3b
> .previous
> .section __ex_table,"a"
>         .align 4
>         .long 1b,4b
>         .long 2b,4b
> .previous") ("=r") 0[
>                         (reg:DI 1 edx)
>                         (reg:SI 0 eax)
>                         (const_int -14 [0xfffffff2])
>                         (reg/v:SI 6 ebp)
>                     ]
>                     [
>                         (asm_input:DI ("A"))
>                         (asm_input:SI ("r"))
>                         (asm_input:SI ("i"))
>                         (asm_input:SI ("0"))
>                     ]  ("fs/readdir.c") 291))
>             (clobber (reg:QI 19 dirflag))
>             (clobber (reg:QI 18 fpsr))
>             (clobber (reg:QI 17 flags))
>         ] ) -1 (insn_list 132 (insn_list 146 (insn_list 165 (nil))))
>     (nil))
> fs/readdir.c:299: confused by earlier errors, bailing out

While upgrading to a sane gcc would be the preferred solution, 
rewriting the change as follows eliminates the error for those who
cannot do so.

Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com>

--- linux-2.6.11-rc1.orig/fs/readdir.c	Wed Jan 12 22:35:03 2005
+++ linux-2.6.11-rc1/fs/readdir.c	Wed Jan 12 22:16:55 2005
@@ -287,9 +287,10 @@
 	lastdirent = buf.previous;
 	if (lastdirent) {
 		typeof(lastdirent->d_off) d_off = file->f_pos;
-		error = count - buf.count;
+		error = -EFAULT;
 		if (__put_user(d_off, &lastdirent->d_off))
-			error = -EFAULT;
+			goto out_putf;
+		error = count - buf.count;
 	}
 
 out_putf:


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

* Re: [PATCH] contort getdents64 to pacify gcc-2.96
  2005-01-13  5:42 ` [PATCH] contort getdents64 to pacify gcc-2.96 Adam Kropelin
@ 2005-01-13  3:51   ` Linus Torvalds
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2005-01-13  3:51 UTC (permalink / raw)
  To: Adam Kropelin; +Cc: Prasanna Meda, Andrew Morton, linux-kernel



On Thu, 13 Jan 2005, Adam Kropelin wrote:
> 
> ...gives gcc-2.96 indigestion:

Ouch. I wonder what triggers it. But your patch looks fine, so let's just 
roll with it.

		Linus

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

end of thread, other threads:[~2005-01-13  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-13  6:34 [PATCH] contort getdents64 to pacify gcc-2.96 Meda, Prasanna
  -- strict thread matches above, loose matches on Subject: below --
2005-01-12  5:09 Linux 2.6.11-rc1 Linus Torvalds
2005-01-13  5:42 ` [PATCH] contort getdents64 to pacify gcc-2.96 Adam Kropelin
2005-01-13  3:51   ` Linus Torvalds

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).