From: Jens Axboe Date: Mon, 10 Jan 2011 19:40:47 +0000 (+0100) Subject: Merge branch 'winfio' X-Git-Tag: fio-1.50-rc2~7 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7ed4d7abf0d7720d532d9680ebf69745d9270a5e;hp=-c Merge branch 'winfio' --- 7ed4d7abf0d7720d532d9680ebf69745d9270a5e diff --combined HOWTO index 9ae34b97,e54382b1..1915bd69 --- a/HOWTO +++ b/HOWTO @@@ -351,7 -351,8 +351,8 @@@ randrepeat=bool For random IO workloads fallocate=bool By default, fio will use fallocate() to advise the system of the size of the file we are going to write. This can be turned off with fallocate=0. May not be available on all - supported platforms. + supported platforms. If using ZFS on Solaris this must be + set to 0 because ZFS doesn't support it. fadvise_hint=bool By default, fio will use fadvise() to advise the kernel on what IO patterns it is likely to issue. Sometimes you @@@ -555,7 -556,7 +556,7 @@@ iodepth=int This defines how many io un job, can be overridden with a larger value for higher concurrency. Note that increasing iodepth beyond 1 will not affect synchronous ioengines (except for small degress when - verify_async is in use). Even async engines my impose OS + verify_async is in use). Even async engines may impose OS restrictions causing the desired depth not to be achieved. This may happen on Linux when using libaio and not setting direct=1, since buffered IO is not async on that OS. Keep an @@@ -585,7 -586,7 +586,7 @@@ iodepth_low=int The low water mark indi the depth drain down to 4 before starting to fill it again. direct=bool If value is true, use non-buffered io. This is usually - O_DIRECT. + O_DIRECT. Note that ZFS on Solaris doesn't support direct io. buffered=bool If value is true, use buffered io. This is the opposite of the 'direct' option. Defaults to true. @@@ -992,8 -993,7 +993,8 @@@ zoneskip=int Skip the specified number io on zones of a file. write_iolog=str Write the issued io patterns to the specified file. See - read_iolog. + read_iolog. Specify a separate file for each job, otherwise + the iologs will be interspersed and the file may be corrupt. read_iolog=str Open an iolog with the specified file name and replay the io patterns it contains. This can be used to store a diff --combined fio.c index 280dbe66,a85f5776..9c556705 --- a/fio.c +++ b/fio.c @@@ -24,6 -24,7 +24,7 @@@ #include #include #include + #include #include #include #include @@@ -988,7 -989,7 +989,7 @@@ void reset_all_stats(struct thread_dat td->io_issues[i] = 0; td->ts.total_io_u[i] = 0; } - + fio_gettime(&tv, NULL); td->ts.runtime[0] = 0; td->ts.runtime[1] = 0; @@@ -1069,18 -1070,14 +1070,18 @@@ static void *thread_main(void *data */ fio_mutex_remove(td->mutex); - if (td->o.uid != -1U && setuid(td->o.uid)) { - td_verror(td, errno, "setuid"); - goto err; - } + /* + * A new gid requires privilege, so we need to do this before setting + * the uid. + */ if (td->o.gid != -1U && setgid(td->o.gid)) { td_verror(td, errno, "setgid"); goto err; } + if (td->o.uid != -1U && setuid(td->o.uid)) { + td_verror(td, errno, "setuid"); + goto err; + } /* * May alter parameters that init_io_u() will use, so we need to