diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2008-03-04 18:09:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-03-25 01:33:49 -0400 |
commit | 815d2d50da41f28aae58f5e9b3c61c3094422749 (patch) | |
tree | f5c3a8f1cd676ef7ed76ea6cc96ccf399310f7fb /fs | |
parent | c9698d6b1a90929e427a165bd8283f803f57d9bd (diff) |
driver core: debug for bad dev_attr_show() return value.
Try to find the culprit who caused
http://bugzilla.kernel.org/show_bug.cgi?id=10150
Cc: <balajirrao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/sysfs/file.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index a271c87c4472..baa663e69388 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kobject.h> | 14 | #include <linux/kobject.h> |
15 | #include <linux/kallsyms.h> | ||
15 | #include <linux/namei.h> | 16 | #include <linux/namei.h> |
16 | #include <linux/poll.h> | 17 | #include <linux/poll.h> |
17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
@@ -86,7 +87,12 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer | |||
86 | * The code works fine with PAGE_SIZE return but it's likely to | 87 | * The code works fine with PAGE_SIZE return but it's likely to |
87 | * indicate truncated result or overflow in normal use cases. | 88 | * indicate truncated result or overflow in normal use cases. |
88 | */ | 89 | */ |
89 | BUG_ON(count >= (ssize_t)PAGE_SIZE); | 90 | if (count >= (ssize_t)PAGE_SIZE) { |
91 | print_symbol("fill_read_buffer: %s returned bad count\n", | ||
92 | (unsigned long)ops->show); | ||
93 | /* Try to struggle along */ | ||
94 | count = PAGE_SIZE - 1; | ||
95 | } | ||
90 | if (count >= 0) { | 96 | if (count >= 0) { |
91 | buffer->needs_read_fill = 0; | 97 | buffer->needs_read_fill = 0; |
92 | buffer->count = count; | 98 | buffer->count = count; |