lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm/secretmem: fix panic when growing a memfd_secret
It's a reasonable option.

Worth noting though that today when it says "larger than the maximum
file size", it refers to the global MAX_NON_LFS (2^31), not
necessarily growing in general. So, we're extending the meaning a bit.

But, I'm happy to send a v2 with EINVAL instead.


On Thu, Apr 7, 2022 at 1:50 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Thu, 31 Mar 2022 10:42:12 -0700 Axel Rasmussen <axelrasmussen@google.com> wrote:
>
> > Any strong opinions on which error code is used? I think overall I
> > would still pick EOPNOTSUPP, but happy to change it if anyone feels
> > strongly.
> >
> > - I think ENOSYS is specific to syscall nr not defined
> > - I think ENOTTY is specific to ioctls
> > - The kernel (sort of mistakenly) defines ENOTSUPP instead of ENOTSUP,
> > but it's marked deprecated and it's recommended to use EOPNOTSUPP
> > instead (despite POSIX saying these should be distinct and for
> > different uses).
>
> `man ftruncate' sayeth
>
> EINVAL The argument length is negative or larger than the maximum file
> size.
>
> which reasonably accurately describes what we're doing here?
>
> + if ((ia_valid & ATTR_SIZE) && inode->i_size)
> + return -EOPNOTSUPP;
>
>

\
 
 \ /
  Last update: 2022-04-11 19:31    [W:0.073 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site