From: Andi Kleen <andi@firstfloor.org>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <andi@firstfloor.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
"Zheng, Shaohui" <shaohui.zheng@intel.com>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH] sysdev: fix prototype for memory_sysdev_class show/store functions
Date: Thu, 14 Jan 2010 13:32:09 +0100 [thread overview]
Message-ID: <20100114123209.GM12241@basil.fritz.box> (raw)
In-Reply-To: <20100114120419.GA3538@localhost>
On Thu, Jan 14, 2010 at 08:04:19PM +0800, Wu Fengguang wrote:
> The function prototype mismatches in call stack:
>
> [<ffffffff81494268>] print_block_size+0x58/0x60
> [<ffffffff81487e3f>] sysdev_class_show+0x1f/0x30
> [<ffffffff811d629b>] sysfs_read_file+0xcb/0x1f0
> [<ffffffff81176328>] vfs_read+0xc8/0x180
>
> Due to prototype mismatch, print_block_size() will sprintf() into
> *attribute instead of *buf, hence user space will read the initial
> zeros from *buf:
> $ hexdump /sys/devices/system/memory/block_size_bytes
> 0000000 0000 0000 0000 0000
> 0000008
>
> After patch:
> cat /sys/devices/system/memory/block_size_bytes
> 0x8000000
>
> This complements commits c29af9636 and 4a0b2b4dbe.
Hmm, this was already fixed in my patch in the original series
SYSFS: Fix type of sysdev class attribute in memory driver
This attribute is really a sysdev_class attribute, not a plain class attribute.
They are identical in layout currently, but this might not always be
the case.
And with the final patches they were identical in layout again anyways.
I don't know why Greg didn't merge that one. Greg, did you forget
some patches?
For the record the full series was:
SYSFS: Pass attribute in sysdev_class attributes show/store
SYSFS: Convert node driver class attributes to be data driven
SYSDEV: Convert cpu driver sysdev class attributes
SYSFS: Add sysfs_add/remove_files utility functions
SYSFS: Add attribute array to sysdev classes
SYSDEV: Convert node driver
SYSDEV: Use sysdev_class attribute arrays in node driver
SYSFS: Add sysdev_create/remove_files
SYSFS: Fix type of sysdev class attribute in memory driver
SYSDEV: Add attribute argument to class_attribute show/store
SYSFS: Add class_attr_string for simple read-only string
SYSFS: Convert some drivers to CLASS_ATTR_STRING
-Andi
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-01-14 12:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 11:59 [PATCH] memory-hotplug: add 0x prefix to HEX block_size_bytes Wu Fengguang
2010-01-14 12:04 ` [PATCH] sysdev: fix prototype for memory_sysdev_class show/store functions Wu Fengguang
2010-01-14 12:32 ` Andi Kleen [this message]
2010-01-18 13:07 ` Wu Fengguang
2010-01-20 2:23 ` Greg KH
2010-01-14 23:29 ` [PATCH] memory-hotplug: add 0x prefix to HEX block_size_bytes Andrew Morton
2010-01-18 13:44 ` Wu Fengguang
2010-01-19 0:38 ` KOSAKI Motohiro
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=20100114123209.GM12241@basil.fritz.box \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=shaohui.zheng@intel.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;
as well as URLs for NNTP newsgroup(s).