From 35274b3eb3db9321682f0856655236ba173c06c2 Mon Sep 17 00:00:00 2001 From: Miao Xie Date: Wed, 21 Nov 2007 14:55:19 -0800 Subject: [PATCH] --- yaml --- r: 74308 b: refs/heads/master c: 8118a859dc7abd873193986c77a8d9bdb877adc8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/sysfs/file.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d0e96a5927b7..a7d5c2a5f095 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 71409a498e96a421bdc20e7275ebc4fab8b14cdc +refs/heads/master: 8118a859dc7abd873193986c77a8d9bdb877adc8 diff --git a/trunk/fs/sysfs/file.c b/trunk/fs/sysfs/file.c index 27d1785b7644..4045bdcc4b33 100644 --- a/trunk/fs/sysfs/file.c +++ b/trunk/fs/sysfs/file.c @@ -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;