lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] kernfs: Add option to enable user xattrs
Hello,

On Tue, Mar 03, 2020 at 11:37:28AM -0800, Daniel Xu wrote:
> It looks like in fs/xattr.c:setxattr, there is already:
>
> ...
> if (size) {
> if (size > XATTR_SIZE_MAX)
> return -E2BIG;
> ...
>
> where XATTR_SIZE_MAX is defined as 64k. Do you want it even smaller?

Oh, I missed that. Order 5 allocations can still be on the big side
tho. Ideally, something like the following?

* Total number of bytes limit as the primary limit so that we can say
that for a given cgroup user xattrs don't consume more than X bytes.
We can pick an arbitrary number which is large enough for most use
cases but not too big. e.g. 128k or whatever.

* Total number of xattrs limit. Again, some arbitrary not too low, not
too high limit.

* Switch to kvmalloc() for attr allocation so that we don't have to
worry about high order allocations.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-03-04 17:40    [W:0.034 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site