Skip to contentSkip to conversation

Make fill_device to stop writing on EDQUOT

PATCH Superseded Martin Bukatovic 3 participants 4 messages Aug 29, 2020 – May 10, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make fill_device to stop writing on EDQUOT

Option fill_device stops writing when we run out of quota as well.

---
 HOWTO       | 3 ++-
 backend.c   | 7 ++++---
 filesetup.c | 4 ++++
 fio.1       | 3 ++-
 4 files changed, 12 insertions(+), 5 deletions(-)
HOWTO +2 -1
index e0403b08..d83f8eb6 100644
@@ -1804,7 +1804,8 @@ I/O size
 .. option:: fill_device=bool, fill_fs=bool
 
 	Sets size to something really large and waits for ENOSPC (no space left on
-	device) as the terminating condition. Only makes sense with sequential
+	device) or EDQUOT (disk quota exceeded)
+	as the terminating condition. Only makes sense with sequential
 	write. For a read workload, the mount point will be filled first then I/O
 	started on the result. This option doesn't make sense if operating on a raw
 	device node, since the size of that is already known by the file system.
backend.c +4 -3
index a4367672..1692dd8f 100644
@@ -392,7 +392,7 @@ static bool break_on_this_error(struct thread_data *td, enum fio_ddir ddir,
 			td_clear_error(td);
 			*retptr = 0;
 			return false;
-		} else if (td->o.fill_device && err == ENOSPC) {
+		} else if (td->o.fill_device && (err == ENOSPC || err == EDQUOT)) {
 			/*
 			 * We expect to hit this error if
 			 * fill_device option is set.
@@ -1099,7 +1099,7 @@ reap:
 	if (td->trim_entries)
 		log_err("fio: %lu trim entries leaked?\n", td->trim_entries);
 
-	if (td->o.fill_device && td->error == ENOSPC) {
+	if (td->o.fill_device && (td->error == ENOSPC || td->error == EDQUOT)) {
 		td->error = 0;
 		fio_mark_td_terminate(td);
 	}
@@ -1114,7 +1114,8 @@ reap:
 
 		if (i) {
 			ret = io_u_queued_complete(td, i);
-			if (td->o.fill_device && td->error == ENOSPC)
+			if (td->o.fill_device &&
+			    (td->error == ENOSPC || td->error == EDQUOT))
 				td->error = 0;
 		}
 
filesetup.c +4 -0
index d382fa24..39a17521 100644
@@ -233,6 +233,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 						 "file, stopping\n");
 					break;
 				}
+				if (__e == EDQUOT) {
+					if (td->o.fill_device)
+						break;
+				}
 				td_verror(td, errno, "write");
 			} else
 				td_verror(td, EIO, "write");
fio.1 +2 -1
index 1c90e4a5..579b115a 100644
@@ -1578,7 +1578,8 @@ of a file. This option is ignored on non-regular files.
 .TP
 .BI fill_device \fR=\fPbool "\fR,\fB fill_fs" \fR=\fPbool
 Sets size to something really large and waits for ENOSPC (no space left on
-device) as the terminating condition. Only makes sense with sequential
+device) or EDQUOT (disk quota exceeded)
+as the terminating condition. Only makes sense with sequential
 write. For a read workload, the mount point will be filled first then I/O
 started on the result. This option doesn't make sense if operating on a raw
 device node, since the size of that is already known by the file system.
Signature · 5 lines
2.26.2


-- 
Martin Bukatovič
#1 lore raw
Quoted 5 lines · Martin Bukatovic
filesetup.c +0 -0
index d382fa24..39a17521 100644

filesetup.c static int extend_file(struct thread_data *td, struct fio_file *f) · line 242

Quoted 10 lines
filesetup.c +4 -0
@@ -233,6 +233,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 						 "file, stopping\n");
 					break;
 				}
+				if (__e == EDQUOT) {
+					if (td->o.fill_device)
+						break;
+				}
 				td_verror(td, errno, "write");
 			} else
 				td_verror(td, EIO, "write");

This should just extent the previous ENOSPC check, and modify the print statement as well.

Signature · 1 line
Jens Axboe
#2 lore raw

(Just a quick ping to Martin on this one because hopefully the changes requested were doable)

Quoted 21 lines · Jens Axboe
Quoted 5 lines · Martin Bukatovic
filesetup.c +0 -0
index d382fa24..39a17521 100644

filesetup.c static int extend_file(struct thread_data *td, struct fio_file *f) · line 242

Quoted 10 lines
filesetup.c +4 -0
@@ -233,6 +233,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
                                               "file, stopping\n");
                                      break;
                              }
+                             if (__e == EDQUOT) {
+                                     if (td->o.fill_device)
+                                             break;
+                             }
                              td_verror(td, errno, "write");
                      } else
                              td_verror(td, EIO, "write");

This should just extent the previous ENOSPC check, and modify the print statement as well.

Quoted 3 lines

--
Jens Axboe

--
Sitsofe | http://sucs.org/~sits/

#3 lore raw
In reply to Jens Axboe
Quoted 11 lines · Jens Axboe
Quoted 10 lines · Martin Bukatovic
filesetup.c +2 -0
index d382fa24..39a17521 100644
@@ -233,6 +233,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 						 "file, stopping\n");
 					break;
 				}
+				if (__e == EDQUOT) {
+					if (td->o.fill_device)
Quoted 8 lines

filesetup.c static int extend_file(struct thread_data *td, struct fio_file *f) · line 242

Quoted 5 lines
filesetup.c +2 -0
+						break;
+				}
 				td_verror(td, errno, "write");
 			} else
 				td_verror(td, EIO, "write");

This should just extent the previous ENOSPC check, and modify the print statement as well.

Fixed in v2 of the patch.

Signature · 1 line
Martin Bukatovič