summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-01-29 20:56:02 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-01-29 20:56:02 (GMT)
commit7b4e2704e773ce719bf99a64d8320a3416aacd5b (patch)
tree6defde1e52b1d7ce137675b68098449ca4a49914 /src/H5O.c
parent87ebee5951c8fe1e9c047d2d96a42d98d612e4ef (diff)
downloadhdf5-7b4e2704e773ce719bf99a64d8320a3416aacd5b.zip
hdf5-7b4e2704e773ce719bf99a64d8320a3416aacd5b.tar.gz
hdf5-7b4e2704e773ce719bf99a64d8320a3416aacd5b.tar.bz2
[svn-r16379] Purpose: Fix a bug encountered when copying shared messages
Description: When attempting to copy an object with a message shared in its own object header, the library attempts to protect the same object header twice. Previously, it was possible for the object header to be protected with write access in one or both of these protects, which would be illegal. The library should now always protect with read only access in this case. The conditions for fixing incorrect datatype versions have been made weaker to support this change. The version will only be corrected if the object header the datatype is in is modified. Tested: jam, smirom (h5committest)
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 52338cc..1d640fa 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -2273,8 +2273,7 @@ H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, H5O_info_t *o
HDassert(oinfo);
/* Get the object header */
- if(NULL == (oh = (H5O_t *)H5AC_protect(oloc->file, dxpl_id, H5AC_OHDR, oloc->addr, NULL, NULL,
- (H5F_get_intent(oloc->file) & H5F_ACC_RDWR) ? H5AC_WRITE : H5AC_READ)))
+ if(NULL == (oh = (H5O_t *)H5AC_protect(oloc->file, dxpl_id, H5AC_OHDR, oloc->addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header")
/* Reset the object info structure */