Merge branch 'linux-2.6'
[powerpc.git] / fs / sysfs / file.c
index d3be1e7..4045bdc 100644 (file)
@@ -119,7 +119,11 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
 
        sysfs_put_active_two(attr_sd);
 
-       BUG_ON(count > (ssize_t)PAGE_SIZE);
+       /*
+        * 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 >= 0) {
                buffer->needs_read_fill = 0;
                buffer->count = count;
@@ -540,7 +544,7 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr,
 /**
  *     sysfs_create_file - create an attribute file for an object.
  *     @kobj:  object we're creating for. 
- *     @attr:  atrribute descriptor.
+ *     @attr:  attribute descriptor.
  */
 
 int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)