summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 720e663..31f757f 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -1912,6 +1912,10 @@ H5AC_protect(H5F_t *f,
HDassert(type->load);
HDassert(H5F_addr_defined(addr));
+ /* Check for invalid access request */
+ if(0 == (f->intent & H5F_ACC_RDWR) && rw == H5AC_WRITE)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
+
#if H5AC__TRACE_FILE_ENABLED
/* For the protect call, only the addr and type id is really necessary
* in the trace file. Include the size of the entry protected as a