]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/sysfs/file.c
SYSFS: Explicitly include required header file slab.h.
[linux-2.6-omap-h63xx.git] / fs / sysfs / file.c
index a271c87c4472d530bee00c35da17a06606dfc97c..a859c32ff93a56b184c3d7a92ebec776d4d9eaa6 100644 (file)
@@ -12,6 +12,8 @@
 
 #include <linux/module.h>
 #include <linux/kobject.h>
+#include <linux/kallsyms.h>
+#include <linux/slab.h>
 #include <linux/namei.h>
 #include <linux/poll.h>
 #include <linux/list.h>
@@ -86,7 +88,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;