[PATCH 6/47] sysfs: Make poll behaviour consistent
- From: Greg KH <greg@xxxxxxxxx>
- Date: Mon, 25 Sep 2006 22:37:26 -0700
From: =?utf-8?q?Juha_Yrj=F6l=E4?= <juha.yrjola@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
fs/sysfs/dir.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 61c4243..5f3d725 100644
--- a/fs/sysfs/dir.c
+++ b/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;
--
1.4.2.1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- [PATCH 7/47] Debugfs: kernel-doc fixes for debugfs
- From: Greg KH
- [PATCH 7/47] Debugfs: kernel-doc fixes for debugfs
- References:
- [GIT PATCH] Driver Core patches for 2.6.18
- From: Greg KH
- [PATCH 1/47] Documentation/ABI: devfs is not obsolete, but removed!
- From: Greg KH
- [PATCH 2/47] deprecate PHYSDEV* keys
- From: Greg KH
- [PATCH 3/47] class_device_create(): make fmt argument 'const char *'
- From: Greg KH
- [PATCH 4/47] device_create(): make fmt argument 'const char *'
- From: Greg KH
- [PATCH 5/47] Driver core: add const to class_create
- From: Greg KH
- [GIT PATCH] Driver Core patches for 2.6.18
- Prev by Date: Re: [PATCH] trident oss: Switch to newer API also fix a bug
- Next by Date: [PATCH 21/47] PM: schedule /sys/devices/.../power/state for removal
- Previous by thread: [PATCH 5/47] Driver core: add const to class_create
- Next by thread: [PATCH 7/47] Debugfs: kernel-doc fixes for debugfs
- Index(es):
Relevant Pages
|