Skip to contentSkip to conversation

sysfs: Make poll behaviour consistent

PATCH New Juha Yrjölä 1 participant 1 message Aug 3, 2006 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/sysfs/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/sysfs/dir.c +1 -1
index 61c4243..5f3d725 100644
@@ -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;
Signature · 1 line
1.4.1