On 11/04, Roman Gushchin wrote: > > -long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type) > +long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type, > + bool override_rlimit) > { > /* Caller must hold a reference to ucounts */ > struct ucounts *iter; > @@ -320,7 +321,8 @@ long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type) > goto unwind; > if (iter == ucounts) > ret = new; > - max = get_userns_rlimit_max(iter->ns, type); > + if (!override_rlimit) > + max = get_userns_rlimit_max(iter->ns, type); > /* > * Grab an extra ucount reference for the caller when > * the rlimit count was previously 0. Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>