[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87abgbgrvt.wl%ysato@users.sourceforge.jp>
Date: Mon, 21 Jul 2008 11:48:38 -0400
From: Yoshinori Sato <ysato@...rs.sourceforge.jp>
To: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] filldir write data missing size
At Sun, 20 Jul 2008 05:11:29 +0900,
OGAWA Hirofumi wrote:
>
> Yoshinori Sato <ysato@...rs.sourceforge.jp> writes:
>
> >> > - if (__put_user(offset, &dirent->d_off))
> >> > + if (__put_user((unsigned long)offset, &dirent->d_off))
> >>
> >> Um.. __put_user() should be already doing it automatically..
> >
> > I'm mistake.
> >
> > I checked object, and found bad code.
> > This problem fix __put_user.
>
> Um.. Could you explain the detail of problem? Is this a workaround or
> something for the bug of some compiler? If so, shouldn't we fix
> __put_user() instead of caller?
>
> E.g. the following or something fixes it? (btw, this is for x86)
>
> #define __put_user(x, ptr) ({ \
> /* Since some compiler generates wrong code, we need __v.?? */ \
> __typeof__(*(ptr)) __v = (x); \
> __put_user_nocheck(__v, (ptr), sizeof(*(ptr))); \
> })
> --
> OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
This problem is sh-linux-gcc v4.1.2 and target sh2(a)-bigendian.
"__put_user(s64, u32_ptr)" compiled.
Correct code.
*u32_ptr = s64 & 0xffffffff;
Bad code.
*u32_ptr = s64 >> 32;
I'm add cast put_user 4byte case.
--
Yoshinori Sato
<ysato@...rs.sourceforge.jp>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists