All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles
@ 2017-05-16 13:57 Andrew Cooper
  2017-05-16 13:58 ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2017-05-16 13:57 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Julien Grall, Ian Jackson, Wei Liu

The logic to optionally exit after a poll() error relies on errno, but
handle_log_reload() does not preserve it.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Julien Grall <julien.grall@arm.com>

For some reason which we haven't tracked down completely yet, an NTP time step
appears to reliably cause xenconsoled to exit, citing "Failure in poll
xs_handle: %d (%s)" with ENOENT.  The NTP time step almost certainly results
in log rotation, but I haven't identifed where the ENOENT came from.
---
 tools/console/daemon/io.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 7e6a886..7e474bb 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -1117,8 +1117,12 @@ void handle_io(void)
 		ret = poll(fds, nr_fds, next_timeout ? poll_timeout : -1);
 
 		if (log_reload) {
+			int saved_errno = errno;
+
 			handle_log_reload();
 			log_reload = 0;
+
+			errno = saved_errno;
 		}
 
 		/* Abort if poll failed, except for EINTR cases
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles
  2017-05-16 13:57 [PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles Andrew Cooper
@ 2017-05-16 13:58 ` Ian Jackson
  2017-05-17 14:08   ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2017-05-16 13:58 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Julien Grall, Wei Liu, Xen-devel

Andrew Cooper writes ("[PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles"):
> The logic to optionally exit after a poll() error relies on errno, but
> handle_log_reload() does not preserve it.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

This is an obvious bugfix and good 4.9 material IMO.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles
  2017-05-16 13:58 ` Ian Jackson
@ 2017-05-17 14:08   ` Julien Grall
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Grall @ 2017-05-17 14:08 UTC (permalink / raw)
  To: Ian Jackson, Andrew Cooper; +Cc: Wei Liu, Xen-devel



On 16/05/17 14:58, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles"):
>> The logic to optionally exit after a poll() error relies on errno, but
>> handle_log_reload() does not preserve it.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>
> This is an obvious bugfix and good 4.9 material IMO.

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-17 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 13:57 [PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles Andrew Cooper
2017-05-16 13:58 ` Ian Jackson
2017-05-17 14:08   ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.