From ebcdccdeeec1673b8f7b12c4176d19982ddad7cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stolarczuk?= Date: Mon, 11 Jan 2021 13:41:54 +0100 Subject: [PATCH] engines/libpmem: set file open/create mode always to RW MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit previously, when created file with a 'write' job it couldn't be open later on, when a 'read' job was ran. Signed-off-by: Łukasz Stolarczuk --- engines/libpmem.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/engines/libpmem.c b/engines/libpmem.c index 2338f0fa..364e384d 100644 --- a/engines/libpmem.c +++ b/engines/libpmem.c @@ -2,7 +2,7 @@ * libpmem: IO engine that uses PMDK libpmem to read and write data * * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation. - * Copyright 2018-2020, Intel Corporation + * Copyright 2018-2021, Intel Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, @@ -97,17 +97,10 @@ static int fio_libpmem_file(struct thread_data *td, struct fio_file *f, size_t length, off_t off) { struct fio_libpmem_data *fdd = FILE_ENG_DATA(f); - mode_t mode = 0; + mode_t mode = S_IWUSR | S_IRUSR; size_t mapped_len; int is_pmem; - if(td_rw(td)) - mode = S_IWUSR | S_IRUSR; - else if (td_write(td)) - mode = S_IWUSR; - else - mode = S_IRUSR; - dprint(FD_IO, "DEBUG fio_libpmem_file\n"); dprint(FD_IO, "f->file_name = %s td->o.verify = %d \n", f->file_name, td->o.verify); -- 2.25.1