lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 Sep 2010 08:55:12 +0200
From:	Michał Nazarewicz <m.nazarewicz@...sung.com>
To:	Greg KH <greg@...ah.com>
Cc:	linux-arm-kernel@...ts.infradead.org,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Daniel Walker <dwalker@...eaurora.org>,
	Russell King <linux@....linux.org.uk>,
	Jonathan Corbet <corbet@....net>,
	Peter Zijlstra <peterz@...radead.org>,
	Pawel Osciak <p.osciak@...sung.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	linux-kernel@...r.kernel.org, Hans Verkuil <hverkuil@...all.nl>,
	Mel Gorman <mel@....ul.ie>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Zach Pfeffer <zpfeffer@...eaurora.org>,
	Minchan Kim <minchan.kim@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-media@...r.kernel.org, linux-mm@...ck.org,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [RFCv5 3/9] mm: cma: Added SysFS support

> On Tue, Sep 07, 2010 at 07:31:30AM +0200, Micha?? Nazarewicz wrote:
>> Thanks for reviewing the sysfs part.  Actually, I was never really sure
>> if I shouldn't rather put this code to debugfs and you got me convinced
>> that I should.  Sysfs somehow looked more appealing from kernel's API
>> point of view -- things seem to be more organised in sysfs than in
>> debugfs.  It seems I'll have to port it to debugfs after all

On Tue, 07 Sep 2010 08:08:18 +0200, Greg KH <greg@...ah.com> wrote:
> Yes, debugfs looks like a much better place for this.

I'll fix that in v6 then.

>>>> +static ssize_t cma_sysfs_region_name_show(struct cma_region *reg, char *page)
>>>> +{
>>>> +	return reg->name ? snprintf(page, PAGE_SIZE, "%s\n", reg->name) : 0;
>>>> +}

>>> Is a name field ever really going to be bigger than a page?

>> For numeric values you are right that snprintf() is a bit paranoid,
>> still I see no good reason why not to use it.

> Same goes for no good reason to use it :)

I somehow prefer to always use "safe" versions of the string manipulation
functions -- it's better to use it everywhere then to forget it in one
place.  Call to sprintf() is translated to vsnprintf() anyway so there's
no performance gain.

-- 
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ