From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BB49C4338F for ; Fri, 30 Jul 2021 17:52:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D91260F00 for ; Fri, 30 Jul 2021 17:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbhG3Rwx (ORCPT ); Fri, 30 Jul 2021 13:52:53 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:36340 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbhG3Rwv (ORCPT ); Fri, 30 Jul 2021 13:52:51 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]:42928) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m9Wgf-00EXgP-S4; Fri, 30 Jul 2021 11:52:45 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:50768 helo=email.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m9Wge-00Gws6-OK; Fri, 30 Jul 2021 11:52:45 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Sven Schnelle Cc: Alexey Gladkov , linux-kernel@vger.kernel.org References: <20210730062854.3601635-1-svens@linux.ibm.com> Date: Fri, 30 Jul 2021 12:52:37 -0500 In-Reply-To: <20210730062854.3601635-1-svens@linux.ibm.com> (Sven Schnelle's message of "Fri, 30 Jul 2021 08:28:54 +0200") Message-ID: <87sfzvbsey.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1m9Wge-00Gws6-OK;;;mid=<87sfzvbsey.fsf@disp2133>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+swV+BZk97MKKgbD5b/s2FwRpqY0xuoho= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH v3] ucounts: add missing data type changes X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sven Schnelle writes: > commit f9c82a4ea89c3 ("Increase size of ucounts to atomic_long_t") > changed the data type of ucounts/ucounts_max to long, but missed to > adjust a few other places. This is noticeable on big endian platforms > from user space because the /proc/sys/user/max_*_names files all > contain 0. Applied. Thank you. > > Fixes: f9c82a4ea89c ("Increase size of ucounts to atomic_long_t") > Signed-off-by: Sven Schnelle > --- > fs/notify/fanotify/fanotify_user.c | 10 ++++++---- > fs/notify/inotify/inotify_user.c | 10 ++++++---- > kernel/ucount.c | 16 ++++++++-------- > 3 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index 64864fb40b40..6576657a1a25 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -58,18 +58,20 @@ struct ctl_table fanotify_table[] = { > { > .procname = "max_user_groups", > .data = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_GROUPS], > - .maxlen = sizeof(int), > + .maxlen = sizeof(long), > .mode = 0644, > - .proc_handler = proc_dointvec_minmax, > + .proc_handler = proc_doulongvec_minmax, > .extra1 = SYSCTL_ZERO, > + .extra2 = SYSCTL_INT_MAX, > }, > { > .procname = "max_user_marks", > .data = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_MARKS], > - .maxlen = sizeof(int), > + .maxlen = sizeof(long), > .mode = 0644, > - .proc_handler = proc_dointvec_minmax, > + .proc_handler = proc_doulongvec_minmax, > .extra1 = SYSCTL_ZERO, > + .extra2 = SYSCTL_INT_MAX, > }, > { > .procname = "max_queued_events", > diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c > index 98f61b31745a..55fe7cdea2fb 100644 > --- a/fs/notify/inotify/inotify_user.c > +++ b/fs/notify/inotify/inotify_user.c > @@ -59,18 +59,20 @@ struct ctl_table inotify_table[] = { > { > .procname = "max_user_instances", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES], > - .maxlen = sizeof(int), > + .maxlen = sizeof(long), > .mode = 0644, > - .proc_handler = proc_dointvec_minmax, > + .proc_handler = proc_doulongvec_minmax, > .extra1 = SYSCTL_ZERO, > + .extra2 = SYSCTL_INT_MAX, > }, > { > .procname = "max_user_watches", > .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_WATCHES], > - .maxlen = sizeof(int), > + .maxlen = sizeof(long), > .mode = 0644, > - .proc_handler = proc_dointvec_minmax, > + .proc_handler = proc_doulongvec_minmax, > .extra1 = SYSCTL_ZERO, > + .extra2 = SYSCTL_INT_MAX, > }, > { > .procname = "max_queued_events", > diff --git a/kernel/ucount.c b/kernel/ucount.c > index 87799e2379bd..f852591e395c 100644 > --- a/kernel/ucount.c > +++ b/kernel/ucount.c > @@ -58,14 +58,14 @@ static struct ctl_table_root set_root = { > .permissions = set_permissions, > }; > > -#define UCOUNT_ENTRY(name) \ > - { \ > - .procname = name, \ > - .maxlen = sizeof(int), \ > - .mode = 0644, \ > - .proc_handler = proc_dointvec_minmax, \ > - .extra1 = SYSCTL_ZERO, \ > - .extra2 = SYSCTL_INT_MAX, \ > +#define UCOUNT_ENTRY(name) \ > + { \ > + .procname = name, \ > + .maxlen = sizeof(long), \ > + .mode = 0644, \ > + .proc_handler = proc_doulongvec_minmax, \ > + .extra1 = SYSCTL_ZERO, \ > + .extra2 = SYSCTL_INT_MAX, \ > } > static struct ctl_table user_table[] = { > UCOUNT_ENTRY("max_user_namespaces"),