aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-24 23:23:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-24 23:23:39 -0700
commit4742dc1d7670bd00253d2dfb637d55446dc6ef81 (patch)
treed22a9b7002413e692b8eda18f20b555c06263921 /fs
parent49741c4d01554c2630cea02cfdf236b17062a912 (diff)
parent815d2d50da41f28aae58f5e9b3c61c3094422749 (diff)
downloadkernel_samsung_smdk4412-4742dc1d7670bd00253d2dfb637d55446dc6ef81.zip
kernel_samsung_smdk4412-4742dc1d7670bd00253d2dfb637d55446dc6ef81.tar.gz
kernel_samsung_smdk4412-4742dc1d7670bd00253d2dfb637d55446dc6ef81.tar.bz2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: driver core: debug for bad dev_attr_show() return value. UIO: add pgprot_noncached() to UIO mmap code
Diffstat (limited to 'fs')
-rw-r--r--fs/sysfs/file.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index a271c87..baa663e 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/kobject.h>
+#include <linux/kallsyms.h>
#include <linux/namei.h>
#include <linux/poll.h>
#include <linux/list.h>
@@ -86,7 +87,12 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
* The code works fine with PAGE_SIZE return but it's likely to
* indicate truncated result or overflow in normal use cases.
*/
- BUG_ON(count >= (ssize_t)PAGE_SIZE);
+ if (count >= (ssize_t)PAGE_SIZE) {
+ print_symbol("fill_read_buffer: %s returned bad count\n",
+ (unsigned long)ops->show);
+ /* Try to struggle along */
+ count = PAGE_SIZE - 1;
+ }
if (count >= 0) {
buffer->needs_read_fill = 0;
buffer->count = count;