Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1356511

[PATCH 3/6] staging: lustre: handle error returned from wait_event_timeout seltest timer

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 3/6] staging: lustre: handle error returned from wait_event_timeout seltest timer
Date 2016-03-12 19:10 +0100
Message-ID <rbW9d-1Em-45@gated-at.bofh.it> (permalink)
References <rbW9d-1Em-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The function wait_event_timeout can fail and return an error. Handle
this case in stt_timer_main().

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/timer.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index 8be5252..ef8a8a7 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -170,20 +170,22 @@ stt_check_timers(unsigned long *last)
 static int
 stt_timer_main(void *arg)
 {
+	int rc = 0;
+
 	cfs_block_allsigs();
 
 	while (!stt_data.stt_shuttingdown) {
 		stt_check_timers(&stt_data.stt_prev_slot);
 
-		wait_event_timeout(stt_data.stt_waitq,
-				   stt_data.stt_shuttingdown,
-				   cfs_time_seconds(STTIMER_SLOTTIME));
+		rc = wait_event_timeout(stt_data.stt_waitq,
+					stt_data.stt_shuttingdown,
+					cfs_time_seconds(STTIMER_SLOTTIME));
 	}
 
 	spin_lock(&stt_data.stt_lock);
 	stt_data.stt_nthreads--;
 	spin_unlock(&stt_data.stt_lock);
-	return 0;
+	return rc;
 }
 
 static int
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Last batch of lnet selftest cleanup James Simmons <jsimmons@infradead.org> - 2016-03-12 19:10 +0100
  [PATCH 3/6] staging: lustre: handle error returned from wait_event_timeout seltest timer James Simmons <jsimmons@infradead.org> - 2016-03-12 19:10 +0100
  [PATCH 2/6] staging: lustre: add missing buffer overflow fix for console.c James Simmons <jsimmons@infradead.org> - 2016-03-12 19:10 +0100

csiph-web