All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] don't print native_fallocate() error if ENOSYS
@ 2017-07-27 20:38 kusumi.tomohiro
  2017-07-27 20:44 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: kusumi.tomohiro @ 2017-07-27 20:38 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi, Tomohiro Kusumi

From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

log_err(ENOSYS) on native_fallocate() failure which was newly added
by 2c3e17be('filesetup: add native fallocate') should be silenced
or somehow be printed only once instead of being a per file message.

This happens on a platform like FreeBSD where posix_fallocate(3)
exists, but native_fallocate() is ENOSYS.

This commit just silences it if errno is set to ENOSYS on return.
"native" is the default mode, thus not printing ENOSYS won't be any
confusing unless fallocate=native is explicitly specified, and
native_fallocate() has dprint() for ENOSYS case anyway.

--
 # uname
 FreeBSD
 # ./fio --name=xxx --ioengine=sync --rw=read --bs=4k --size=10m --nrfiles=20
 xxx: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=sync, iodepth=1
 fio-2.99-23-gdad0
 Starting 1 process
 xxx: Laying out IO files (20 files / total 10MiB)
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 fio: native_fallocate call failed: Function not implemented
 ...

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 filesetup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/filesetup.c b/filesetup.c
index 362997c..839aefc 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -67,7 +67,7 @@ static void fallocate_file(struct thread_data *td, struct fio_file *f)
 	switch (td->o.fallocate_mode) {
 	case FIO_FALLOCATE_NATIVE:
 		r = native_fallocate(td, f);
-		if (r != 0)
+		if (r != 0 && errno != ENOSYS)
 			log_err("fio: native_fallocate call failed: %s\n",
 					strerror(errno));
 		break;
-- 
2.9.4



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

* Re: [PATCH] don't print native_fallocate() error if ENOSYS
  2017-07-27 20:38 [PATCH] don't print native_fallocate() error if ENOSYS kusumi.tomohiro
@ 2017-07-27 20:44 ` Jens Axboe
  2017-07-28  6:41   ` Sitsofe Wheeler
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2017-07-27 20:44 UTC (permalink / raw)
  To: kusumi.tomohiro, fio; +Cc: Tomohiro Kusumi

On 07/27/2017 02:38 PM, kusumi.tomohiro@gmail.com wrote:
> From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
> 
> log_err(ENOSYS) on native_fallocate() failure which was newly added
> by 2c3e17be('filesetup: add native fallocate') should be silenced
> or somehow be printed only once instead of being a per file message.
> 
> This happens on a platform like FreeBSD where posix_fallocate(3)
> exists, but native_fallocate() is ENOSYS.
> 
> This commit just silences it if errno is set to ENOSYS on return.
> "native" is the default mode, thus not printing ENOSYS won't be any
> confusing unless fallocate=native is explicitly specified, and
> native_fallocate() has dprint() for ENOSYS case anyway.

I think that's the right fix, ENOSYS is expected for some setups,
so it need not be a visible error.

-- 
Jens Axboe



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

* Re: [PATCH] don't print native_fallocate() error if ENOSYS
  2017-07-27 20:44 ` Jens Axboe
@ 2017-07-28  6:41   ` Sitsofe Wheeler
  0 siblings, 0 replies; 3+ messages in thread
From: Sitsofe Wheeler @ 2017-07-28  6:41 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Tomohiro Kusumi, fio, Tomohiro Kusumi

On 27 July 2017 at 21:44, Jens Axboe <axboe@kernel.dk> wrote:
> On 07/27/2017 02:38 PM, kusumi.tomohiro@gmail.com wrote:
>> From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
>>
>> log_err(ENOSYS) on native_fallocate() failure which was newly added
>> by 2c3e17be('filesetup: add native fallocate') should be silenced
>> or somehow be printed only once instead of being a per file message.
>>
>> This happens on a platform like FreeBSD where posix_fallocate(3)
>> exists, but native_fallocate() is ENOSYS.
>>
>> This commit just silences it if errno is set to ENOSYS on return.
>> "native" is the default mode, thus not printing ENOSYS won't be any
>> confusing unless fallocate=native is explicitly specified, and
>> native_fallocate() has dprint() for ENOSYS case anyway.
>
> I think that's the right fix, ENOSYS is expected for some setups,
> so it need not be a visible error.

I wonder if the default actually be set to "none" on all systems that
don't implement a native fallocate regardless of whether they
implement posix_fallocate?

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


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

end of thread, other threads:[~2017-07-28  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 20:38 [PATCH] don't print native_fallocate() error if ENOSYS kusumi.tomohiro
2017-07-27 20:44 ` Jens Axboe
2017-07-28  6:41   ` Sitsofe Wheeler

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.