2019-08-27 20:22:28

by Michal Suchánek

[permalink] [raw]
Subject: [PATCH 1/4] fs: always build llseek.

64bit !COMPAT does not build because the llseek syscall is in the tables.

Signed-off-by: Michal Suchanek <[email protected]>
---
fs/read_write.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 5bbf587f5bc1..9db56931eb26 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -331,7 +331,6 @@ COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned i
}
#endif

-#if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT)
SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
unsigned long, offset_low, loff_t __user *, result,
unsigned int, whence)
@@ -360,7 +359,6 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
fdput_pos(f);
return retval;
}
-#endif

int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count)
{
--
2.22.0


2019-08-28 15:18:14

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

On Tue, Aug 27, 2019 at 10:21:06PM +0200, Michal Suchanek wrote:
> 64bit !COMPAT does not build because the llseek syscall is in the tables.

Well, this will bloat thinkgs like 64-bit RISC-V for no good reason.
Please introduce a WANT_LSEEK like symbol that ppc64 can select instead.

2019-08-28 16:16:57

by Michal Suchánek

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

On Wed, 28 Aug 2019 08:15:52 -0700
Christoph Hellwig <[email protected]> wrote:

> On Tue, Aug 27, 2019 at 10:21:06PM +0200, Michal Suchanek wrote:
> > 64bit !COMPAT does not build because the llseek syscall is in the tables.
>
> Well, this will bloat thinkgs like 64-bit RISC-V for no good reason.
> Please introduce a WANT_LSEEK like symbol that ppc64 can select instead.

It also builds when llseek is marked as 32bit only in syscall.tbl

It seems it was handled specially in some way before syscall.tbl was
added, though (removed in ab66dcc76d6ab8fae9d69d149ae38c42605e7fc5)

Thanks

Michal

2019-08-28 18:14:33

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

Michal Suchanek <[email protected]> writes:

> 64bit !COMPAT does not build because the llseek syscall is in the
> tables.

Do I read this right you have a 128 bit offset to llseek on ppc64?

Looking at the signature it does not appear to make sense to build this
function on any 64bit platform.

Perhaps the proper fix to to take llseek out of your syscall tables?

Eric

> Signed-off-by: Michal Suchanek <[email protected]>
> ---
> fs/read_write.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 5bbf587f5bc1..9db56931eb26 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -331,7 +331,6 @@ COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned i
> }
> #endif
>
> -#if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT)
> SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
> unsigned long, offset_low, loff_t __user *, result,
> unsigned int, whence)
> @@ -360,7 +359,6 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
> fdput_pos(f);
> return retval;
> }
> -#endif
>
> int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count)
> {

2019-08-28 18:18:16

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

[email protected] (Eric W. Biederman) writes:

> Michal Suchanek <[email protected]> writes:
>
>> 64bit !COMPAT does not build because the llseek syscall is in the
>> tables.
>
> Do I read this right you have a 128 bit offset to llseek on ppc64?
>
> Looking at the signature it does not appear to make sense to build this
> function on any 64bit platform.
>
> Perhaps the proper fix to to take llseek out of your syscall tables?

Sorry I missed seeing the 2 newer version of the patchset in my inbox
it seems you have already made the change I am suggesting.

Never mind.

Eric

2019-08-29 06:25:10

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

On Wed, Aug 28, 2019 at 06:15:40PM +0200, Michal Such?nek wrote:
> On Wed, 28 Aug 2019 08:15:52 -0700
> Christoph Hellwig <[email protected]> wrote:
>
> > On Tue, Aug 27, 2019 at 10:21:06PM +0200, Michal Suchanek wrote:
> > > 64bit !COMPAT does not build because the llseek syscall is in the tables.
> >
> > Well, this will bloat thinkgs like 64-bit RISC-V for no good reason.
> > Please introduce a WANT_LSEEK like symbol that ppc64 can select instead.
>
> It also builds when llseek is marked as 32bit only in syscall.tbl
>
> It seems it was handled specially in some way before syscall.tbl was
> added, though (removed in ab66dcc76d6ab8fae9d69d149ae38c42605e7fc5)

Independ of if you need it on a purely 64-bit build on powerpc (which
I'll let the experts figure out) it is not needed on a purely 64-bit
build on other platforms. So please make sure it is still built
conditional, just possibly with an opt-in for powerpc.

2019-08-29 10:08:37

by Michal Suchánek

[permalink] [raw]
Subject: Re: [PATCH 1/4] fs: always build llseek.

On Wed, 28 Aug 2019 23:22:00 -0700
Christoph Hellwig <[email protected]> wrote:

> On Wed, Aug 28, 2019 at 06:15:40PM +0200, Michal Suchánek wrote:
> > On Wed, 28 Aug 2019 08:15:52 -0700
> > Christoph Hellwig <[email protected]> wrote:
> >
> > > On Tue, Aug 27, 2019 at 10:21:06PM +0200, Michal Suchanek wrote:
> > > > 64bit !COMPAT does not build because the llseek syscall is in the tables.
> > >
> > > Well, this will bloat thinkgs like 64-bit RISC-V for no good reason.
> > > Please introduce a WANT_LSEEK like symbol that ppc64 can select instead.
> >
> > It also builds when llseek is marked as 32bit only in syscall.tbl
> >
> > It seems it was handled specially in some way before syscall.tbl was
> > added, though (removed in ab66dcc76d6ab8fae9d69d149ae38c42605e7fc5)
>
> Independ of if you need it on a purely 64-bit build on powerpc (which
> I'll let the experts figure out) it is not needed on a purely 64-bit
> build on other platforms. So please make sure it is still built
> conditional, just possibly with an opt-in for powerpc.

AFAICT it is needed for all 64bit platforms with unified syscall.tbl.

I modified the syscall.tbl for powerpc to not need the syscall with
64bit only build but other platforms are still broken. There are a few
platforms that use multiple tables and on those the 64bit one indeed
does not contain llseek.

Thanks

Michal