From: Jens Axboe Date: Fri, 7 Feb 2014 17:56:15 +0000 (-0700) Subject: Fix crash with file locking and dup'ed files X-Git-Tag: fio-2.1.5~11 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=67ad92428bb19008354ca20e614050241e9f17e7 Fix crash with file locking and dup'ed files Ensure that we properly inherit the file locks when duplicating files. Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index d67f1124..d1702e29 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1343,6 +1343,11 @@ void dup_files(struct thread_data *td, struct thread_data *org) __f->filetype = f->filetype; } + if (td->o.file_lock_mode == FILE_LOCK_EXCLUSIVE) + __f->lock = f->lock; + else if (td->o.file_lock_mode == FILE_LOCK_READWRITE) + __f->rwlock = f->rwlock; + td->files[i] = __f; } }