diff mbox series

[1/4] fs: always build llseek.

Message ID 80b1955b86fb81e4642881d498068b5a540ef029.1566936688.git.msuchanek@suse.de (mailing list archive)
State New, archived
Headers show
Series Disable compat cruft on ppc64le | expand

Commit Message

Michal Suchánek Aug. 27, 2019, 8:21 p.m. UTC
64bit !COMPAT does not build because the llseek syscall is in the tables.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 fs/read_write.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Christoph Hellwig Aug. 28, 2019, 3:15 p.m. UTC | #1
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.
Michal Suchánek Aug. 28, 2019, 4:15 p.m. UTC | #2
On Wed, 28 Aug 2019 08:15:52 -0700
Christoph Hellwig <hch@infradead.org> 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
Eric W. Biederman Aug. 28, 2019, 6:13 p.m. UTC | #3
Michal Suchanek <msuchanek@suse.de> 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 <msuchanek@suse.de>
> ---
>  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)
>  {
Eric W. Biederman Aug. 28, 2019, 6:16 p.m. UTC | #4
ebiederm@xmission.com (Eric W. Biederman) writes:

> Michal Suchanek <msuchanek@suse.de> 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
Christoph Hellwig Aug. 29, 2019, 6:22 a.m. UTC | #5
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 <hch@infradead.org> 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.
Michal Suchánek Aug. 29, 2019, 10:06 a.m. UTC | #6
On Wed, 28 Aug 2019 23:22:00 -0700
Christoph Hellwig <hch@infradead.org> 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 <hch@infradead.org> 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
diff mbox series

Patch

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)
 {