Skip to contentSkip to conversation

fix fd leak in xenstore

PATCH In review Olaf Hering 3 participants 3 messages Sep 14, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix fd leak in xenstore

Missing from commit 'libxl: Backported stuff from unstable' Without this change, xs_daemon_open/xs_daemon_close will leak filedescriptors.

---
 tools/xenstore/xs.c |    2 ++
 1 file changed, 2 insertions(+)
tools/xenstore/xs.c +2 -0
@@ -285,6 +285,8 @@ void xs_daemon_close(struct xs_handle *h
 	mutex_unlock(&h->request_mutex);
 	mutex_unlock(&h->reply_mutex);
 	mutex_unlock(&h->watch_mutex);
+
+	close_fds_free(h);
 }
 
 static bool read_all(int fd, void *data, unsigned int len)
#1 lore raw
Quoted 12 lines · Olaf Hering

Missing from commit 'libxl: Backported stuff from unstable' Without this change, xs_daemon_open/xs_daemon_close will leak filedescriptors.

---
 tools/xenstore/xs.c |    2 ++
 1 file changed, 2 insertions(+)

tools/xenstore/xs.c void xs_daemon_close(struct xs_handle *h · line 292

Quoted 8 lines
tools/xenstore/xs.c +2 -0
@@ -285,6 +285,8 @@ void xs_daemon_close(struct xs_handle *h
 	mutex_unlock(&h->request_mutex);
 	mutex_unlock(&h->reply_mutex);
 	mutex_unlock(&h->watch_mutex);
+
+	close_fds_free(h);
 }
 
 static bool read_all(int fd, void *data, unsigned int len)

ack, well spotted

Gianni

Acked-by Acked-by Gianni Tedesco on v1 1/1
#2 lore raw

Re: [PATCH / 4.0.1] fix fd leak in xenstore [and 1 more messages]

In reply to Olaf Hering

Olaf Hering writes ("[Xen-devel] [PATCH / 4.0.1] fix fd leak in xenstore"):

Quoted 3 lines

Missing from commit 'libxl: Backported stuff from unstable' Without this change, xs_daemon_open/xs_daemon_close will leak filedescriptors.

You are right.

Keir, could you please apply Olaf's patch to xen-4.0-testing ?

Thanks,
Ian.