* [RFC PATCH] error out if ENOSPC during file layout
@ 2020-11-20 5:00 Kushal Kumaran
2020-11-22 14:29 ` Sitsofe Wheeler
2020-11-22 16:55 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Kushal Kumaran @ 2020-11-20 5:00 UTC (permalink / raw)
To: fio
Hi,
When I run fio with --create_only=1 and it runs out of space, it still
exits with status 0. I could not figure out if this was intentional
(except for the fill_device case, where this is obviously the expected
behavior).
$ cat ~/fio
[global]
ioengine=posixaio
rw=readwrite
size=2g
directory=${HOME}/mounts/testdisk
thread=1
[trivial-readwrite-1g]
$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/loop6 976M 2.6M 907M 1% /home/kushal/mounts/testdisk
$ fio ~/fio --create_only=1
trivial-readwrite-1g: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=pos
ixaio, iodepth=1
fio-3.12
Starting 1 thread
trivial-readwrite-1g: Laying out IO file (1 file / 2048MiB)
fio: ENOSPC on laying out file, stopping
Run status group 0 (all jobs):
Disk stats (read/write):
loop6: ios=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
$ echo $?
0
A trivial patch for this gives me the behavior I expect.
---
filesetup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/filesetup.c b/filesetup.c
index f4360a6f..42c5f630 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -231,13 +231,12 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
break;
log_info("fio: ENOSPC on laying out "
"file, stopping\n");
- break;
}
td_verror(td, errno, "write");
} else
td_verror(td, EIO, "write");
- break;
+ goto err;
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] error out if ENOSPC during file layout
2020-11-20 5:00 [RFC PATCH] error out if ENOSPC during file layout Kushal Kumaran
@ 2020-11-22 14:29 ` Sitsofe Wheeler
2020-11-22 16:55 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Sitsofe Wheeler @ 2020-11-22 14:29 UTC (permalink / raw)
To: Jens Axboe; +Cc: Kushal Kumaran, fio
Hi,
This does look like better behaviour to me.
Jens, can we pick this one up?
On Fri, 20 Nov 2020 at 05:09, Kushal Kumaran <kushal@locationd.net> wrote:
>
> Hi,
>
> When I run fio with --create_only=1 and it runs out of space, it still
> exits with status 0. I could not figure out if this was intentional
> (except for the fill_device case, where this is obviously the expected
> behavior).
>
> $ cat ~/fio
> [global]
> ioengine=posixaio
> rw=readwrite
> size=2g
> directory=${HOME}/mounts/testdisk
> thread=1
>
> [trivial-readwrite-1g]
> $ df -h .
> Filesystem Size Used Avail Use% Mounted on
> /dev/loop6 976M 2.6M 907M 1% /home/kushal/mounts/testdisk
> $ fio ~/fio --create_only=1
> trivial-readwrite-1g: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=pos
> ixaio, iodepth=1
> fio-3.12
> Starting 1 thread
> trivial-readwrite-1g: Laying out IO file (1 file / 2048MiB)
> fio: ENOSPC on laying out file, stopping
>
>
> Run status group 0 (all jobs):
>
> Disk stats (read/write):
> loop6: ios=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
> $ echo $?
> 0
>
> A trivial patch for this gives me the behavior I expect.
>
> ---
> filesetup.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/filesetup.c b/filesetup.c
> index f4360a6f..42c5f630 100644
> --- a/filesetup.c
> +++ b/filesetup.c
> @@ -231,13 +231,12 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
> break;
> log_info("fio: ENOSPC on laying out "
> "file, stopping\n");
> - break;
> }
> td_verror(td, errno, "write");
> } else
> td_verror(td, EIO, "write");
>
> - break;
> + goto err;
> }
> }
>
> --
> 2.20.1
--
Sitsofe | http://sucs.org/~sits/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] error out if ENOSPC during file layout
2020-11-20 5:00 [RFC PATCH] error out if ENOSPC during file layout Kushal Kumaran
2020-11-22 14:29 ` Sitsofe Wheeler
@ 2020-11-22 16:55 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-11-22 16:55 UTC (permalink / raw)
To: Kushal Kumaran, fio
On 11/19/20 10:00 PM, Kushal Kumaran wrote:
> Hi,
>
> When I run fio with --create_only=1 and it runs out of space, it still
> exits with status 0. I could not figure out if this was intentional
> (except for the fill_device case, where this is obviously the expected
> behavior).
>
> $ cat ~/fio
> [global]
> ioengine=posixaio
> rw=readwrite
> size=2g
> directory=${HOME}/mounts/testdisk
> thread=1
>
> [trivial-readwrite-1g]
> $ df -h .
> Filesystem Size Used Avail Use% Mounted on
> /dev/loop6 976M 2.6M 907M 1% /home/kushal/mounts/testdisk
> $ fio ~/fio --create_only=1
> trivial-readwrite-1g: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=pos
> ixaio, iodepth=1
> fio-3.12
> Starting 1 thread
> trivial-readwrite-1g: Laying out IO file (1 file / 2048MiB)
> fio: ENOSPC on laying out file, stopping
>
>
> Run status group 0 (all jobs):
>
> Disk stats (read/write):
> loop6: ios=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
> $ echo $?
> 0
>
> A trivial patch for this gives me the behavior I expect.
That seems reasonable. Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-22 16:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-20 5:00 [RFC PATCH] error out if ENOSPC during file layout Kushal Kumaran
2020-11-22 14:29 ` Sitsofe Wheeler
2020-11-22 16:55 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox