From 11ff4c37e3fc4fa4eb03c55942b89f92eb01263f Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Fri, 15 Jun 2018 15:05:28 -0600 Subject: [PATCH 1/1] filesetup: make trim jobs respect --readonly during file open Open files for trim workloads with the O_RDWR access mode only when the --readonly option is absent. --- filesetup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index 75694bd8..a2427a1a 100644 --- a/filesetup.c +++ b/filesetup.c @@ -674,7 +674,8 @@ open_again: from_hash = file_lookup_open(f, flags); } else if (td_trim(td)) { assert(!td_rw(td)); /* should have matched above */ - flags |= O_RDWR; + if (!read_only) + flags |= O_RDWR; from_hash = file_lookup_open(f, flags); } -- 2.25.1