[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a19n3pa+hRfC-ToTPhH2hvgYY=mXo_u6ZWkbbSSY5_JAA@mail.gmail.com>
Date: Wed, 22 Dec 2021 13:46:47 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Guo Ren <guoren@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, Palmer Dabbelt <palmer@...belt.com>,
Anup Patel <anup.patel@....com>,
gregkh <gregkh@...uxfoundation.org>,
liush <liush@...winnertech.com>, Wei Fu <wefu@...hat.com>,
Drew Fustini <drew@...gleboard.org>,
Wang Junqiang <wangjunqiang@...as.ac.cn>,
Wei Wu (吴伟) <lazyparser@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
linux-csky@...r.kernel.org, Guo Ren <guoren@...ux.alibaba.com>
Subject: Re: [PATCH 03/13] riscv: compat: Add basic compat date type implementation
On Wed, Dec 22, 2021 at 1:03 PM Guo Ren <guoren@...nel.org> wrote:
> On Wed, Dec 22, 2021 at 1:13 AM Arnd Bergmann <arnd@...db.de> wrote:
> > On Tue, Dec 21, 2021 at 5:35 PM <guoren@...nel.org> wrote:
> >
> > > +struct compat_stat {
> > > + compat_ulong_t st_dev;
> > > + compat_ulong_t st_ino;
> > > + compat_uint_t st_mode;
> > > + compat_uint_t st_nlink;
> >
> > You should not need a compat_stat, because native rv32 does not have a
> > stat() syscall.
> We need it:
>
> $ make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu-
> EXTRA_CFLAGS+=-g O=../build-riscv/ Image -j > /dev/null
> /home/guoren/source/kernel/riscv-linux/fs/stat.c: In function 'cp_compat_stat':
> /home/guoren/source/kernel/riscv-linux/fs/stat.c:645:21: error:
> storage size of 'tmp' isn't known
> 645 | struct compat_stat tmp;
I think that's just a bug in fs/stat.c. Every other architecture so
far needed it,
just not riscv, so we should add an appropriate #ifdef here. I would replace
#ifdef CONFIG_COMPAT around these with __ARCH_WANT_COMPAT_STAT
and then change all other compat architectures to define that depending
on the configuration.
Arnd
Powered by blists - more mailing lists