From a6ed599706664a0343e0b754213ade4b63665a4d Mon Sep 17 00:00:00 2001
From: Adrian Hunter <ext-adrian.hunter@nokia.com>
Date: Mon, 8 Oct 2007 17:43:16 +0300
Subject: fs-tests: allow for ENOSPC in test fwrite00

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
---
 tests/fs-tests/stress/atoms/fwrite00.c | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'tests/fs-tests/stress')

diff --git a/tests/fs-tests/stress/atoms/fwrite00.c b/tests/fs-tests/stress/atoms/fwrite00.c
index 2f40b3d..fd691be 100644
--- a/tests/fs-tests/stress/atoms/fwrite00.c
+++ b/tests/fs-tests/stress/atoms/fwrite00.c
@@ -56,6 +56,14 @@ void filestress00(void)
 		if (fd == -1) {
 			fd = open(file_name, O_CREAT | O_WRONLY,
 			  S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+			if (fd == -1 && errno == ENOSPC) {
+				/* Break if repeat count exceeded */
+				if (tests_repeat_parameter > 0 && --repeat <= 0)
+					break;
+				/* Sleep 2 secs and try again */
+				sleep(2);
+				continue;
+			}
 			CHECK(fd != -1);
 			deleted = 0;
 			if (tests_unlink_flag) {
-- 
cgit v1.2.3