Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760112AbYG1S6k (ORCPT ); Mon, 28 Jul 2008 14:58:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756180AbYG1S63 (ORCPT ); Mon, 28 Jul 2008 14:58:29 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.123]:33874 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755858AbYG1S62 (ORCPT ); Mon, 28 Jul 2008 14:58:28 -0400 Date: Mon, 28 Jul 2008 14:58:16 -0400 Message-ID: <87ljzlzvhz.wl%ysato@users.sourceforge.jp> From: Yoshinori Sato To: OGAWA Hirofumi Cc: Andrew Morton , lkml Subject: Re: [PATCH] filldir write data missing size In-Reply-To: <878wvu9b6n.fsf@devron.myhome.or.jp> References: <87k5fi4l49.wl%ysato@users.sourceforge.jp> <871w1pn5wz.fsf@devron.myhome.or.jp> <87iqv1wwy1.wl%ysato@users.sourceforge.jp> <87r69pk51q.fsf@devron.myhome.or.jp> <87abgbgrvt.wl%ysato@users.sourceforge.jp> <878wvu9b6n.fsf@devron.myhome.or.jp> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.2 (x86_64-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1897 Lines: 64 At Tue, 22 Jul 2008 06:31:12 +0900, OGAWA Hirofumi wrote: > > Yoshinori Sato writes: > > > 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. > > I see. How about the following patch? I guess the problems of this type > should be fixed. > > diff -puN include/asm-sh/uaccess_32.h~sh-fix include/asm-sh/uaccess_32.h > --- linux-2.6/include/asm-sh/uaccess_32.h~sh-fix 2008-07-22 06:20:15.000000000 +0900 > +++ linux-2.6-hirofumi/include/asm-sh/uaccess_32.h 2008-07-22 06:25:26.000000000 +0900 > @@ -211,8 +211,9 @@ do { \ > ({ \ > long __pu_err; \ > __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ > + __typeof__(*(ptr)) __pu_val = x; \ > __chk_user_ptr(ptr); \ > - __put_user_size((x), __pu_addr, (size), __pu_err); \ > + __put_user_size(__pu_val, __pu_addr, (size), __pu_err); \ > __pu_err; \ > }) > > @@ -220,8 +221,9 @@ do { \ > ({ \ > long __pu_err = -EFAULT; \ > __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ > + __typeof__(*(ptr)) __pu_val = x; \ > if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \ > - __put_user_size((x), __pu_addr, (size), \ > + __put_user_size(__pu_val, __pu_addr, (size), \ > __pu_err); \ > __pu_err; \ > }) > _ > -- > OGAWA Hirofumi Sorry too late reply. This fix is good. But I send other workaround fix. Thanks. -- Yoshinori Sato -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/