lkml.org 
[lkml]   [2008]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] filldir write data missing size
Date
Yoshinori Sato <ysato@users.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@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2008-07-19 22:13    [W:0.067 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site