aboutsummaryrefslogtreecommitdiff
path: root/fs/sysfs
diff options
context:
space:
mode:
authorJuha Yrjölä <juha.yrjola@solidboot.com>2006-08-03 19:06:25 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-25 21:08:36 -0700
commiteea3f8911f34001d2450a272c2d02f175279b53c (patch)
tree0565109ca2020176b42e1f4bd2f14dc08aae84ba /fs/sysfs
parentab7d7371acc68fa9130b079a9ba879191202035f (diff)
sysfs: Make poll behaviour consistent
When no events have been reported by sysfs_notify(), sd->s_events was previously set to zero. The initial value for new readers is also zero, so poll was blocking, regardless of whether the attribute was read by the process or not. Make poll behave consistently by setting the initial value of sd->s_events to non-zero. Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 61c42430cba..5f3d725d112 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -43,7 +43,7 @@ static struct sysfs_dirent * sysfs_new_dirent(struct sysfs_dirent * parent_sd,
memset(sd, 0, sizeof(*sd));
atomic_set(&sd->s_count, 1);
- atomic_set(&sd->s_event, 0);
+ atomic_set(&sd->s_event, 1);
INIT_LIST_HEAD(&sd->s_children);
list_add(&sd->s_sibling, &parent_sd->s_children);
sd->s_element = element;