From: Michal Hocko <mhocko@suse.cz>
To: CAI Qian <caiqian@redhat.com>
Cc: linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Nishanth Aravamudan <nacc@us.ibm.com>
Subject: Re: [RFC] /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages
Date: Wed, 5 Jan 2011 16:59:38 +0100 [thread overview]
Message-ID: <20110105155938.GE21349@tiehlicka.suse.cz> (raw)
In-Reply-To: <1844733704.140190.1294241807437.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
On Wed 05-01-11 10:36:47, CAI Qian wrote:
> From f90b54f9f5607128e375bd78d21e751c433b3cf6 Mon Sep 17 00:00:00 2001
> From: CAI Qian <caiqian@redhat.com>
> Date: Wed, 5 Jan 2011 23:26:57 +0800
> Subject: [PATCH] hugetlbfs: check invalid nr_hugepages and nr_overcommit_hugepages
>
> First, nr_*hugepages* in procfs and sysfs do not check for invalid
> input like "". Second, when using oversize pages, nr_*hugepages* are
> expected to be allocated during boot time. Therefore, return -EINVAL
> for those cases.
I think that the two things should be split into two patches - one for
the proper input data handling and the other one for the size check.
Albeit, I am not sure about the size check because this is a thing that
is just a current implementation limitation and can be change later.
>
> Signed-off-by: CAI Qian <caiqian@redhat.com>
> ---
> fs/sysfs/file.c | 2 ++
> mm/hugetlb.c | 18 ++++++++++++++++--
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> index da3fefe..9f4ea67 100644
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -207,6 +207,8 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
> return -ENODEV;
>
> rc = ops->store(kobj, attr_sd->s_attr.attr, buffer->page, count);
> + if (!rc)
> + return -EINVAL;
This doesn't look correct, you would imbalance sysfs_{get,put}_active.
[...]
--
Michal Hocko
L3 team
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-01-05 15:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1060163918.101411.1293793346203.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-12-31 11:08 ` CAI Qian
2011-01-04 9:56 ` Michal Hocko
2011-01-04 10:21 ` CAI Qian
2011-01-04 10:52 ` Michal Hocko
2011-01-05 4:52 ` CAI Qian
2011-01-05 8:43 ` Michal Hocko
2011-01-05 8:54 ` CAI Qian
2011-01-05 9:51 ` Michal Hocko
2011-01-05 15:36 ` CAI Qian
2011-01-05 15:59 ` Michal Hocko [this message]
2011-01-05 16:42 ` CAI Qian
2011-01-05 16:44 ` Michal Hocko
2011-01-05 17:00 ` CAI Qian
2011-01-05 20:59 ` Andrew Morton
2011-01-06 10:04 ` PATCH: hugetlb: handle NODEMASK_ALLOC failure correctly Michal Hocko
2011-01-06 20:38 ` Andrew Morton
2011-01-06 22:23 ` Michal Hocko
2011-01-04 17:21 ` [RFC] /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages Eric B Munson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110105155938.GE21349@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=caiqian@redhat.com \
--cc=linux-mm@kvack.org \
--cc=nacc@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox