From jey@mail.solidboot.com Thu Aug 3 09:25:07 2006 Date: Thu, 3 Aug 2006 19:06:25 +0300 From: Juha =?iso-8859-1?B?WXJq9mzk?= To: gregkh@suse.de Cc: Subject: sysfs: Make poll behaviour consistent Message-ID: <20060803160625.GA24946@mail.solidboot.com> Content-Disposition: inline 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 Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- gregkh-2.6.orig/fs/sysfs/dir.c +++ gregkh-2.6/fs/sysfs/dir.c @@ -43,7 +43,7 @@ static struct sysfs_dirent * sysfs_new_d 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;