summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-07-18 22:43:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-07-18 22:43:30 (GMT)
commitde106315771c4c227c4e73d9194494a240b92fd2 (patch)
tree16aa02432eba532a89f5421e29f492a2801685be /src
parent69d7f7312a6664d1f0ce4d617f08fee7f0154442 (diff)
downloadhdf5-de106315771c4c227c4e73d9194494a240b92fd2.zip
hdf5-de106315771c4c227c4e73d9194494a240b92fd2.tar.gz
hdf5-de106315771c4c227c4e73d9194494a240b92fd2.tar.bz2
[svn-r21120] Description:
Check in ugly version of fix for Jira #7638. I'm going to leave the issue open in Jira and when the library has been refactored to use shared file pointers (instead of top file pointers) for file operations, I'll uncomment the check in src/H5Oshared.c Tested on: Mac OS X/32 10.6.8 (amazon) w/debug (too small for h5committest)
Diffstat (limited to 'src')
-rw-r--r--src/H5Oshared.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 68fc4ad..376a2ad 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -243,8 +243,17 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
* new object header. Adjust the reference count on that
* object header.
*/
- if(shared->file->shared != f->shared)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "interfile hard links are not allowed")
+ /* Unfortunately, it is possible for the shared->file pointer to become
+ * invalid if the oh is kept in cache (which is contained in
+ * shared->file->shared while shared->file is closed. Just ignore
+ * shared->file until the "top-level" file pointer is removed at some
+ * point in the future. -NAF */
+ /* This is related to Jira issue #7638 and should be uncommented after
+ * the library has been refactored to shift to using shared file
+ * pointers for file operations, instead of using top file pointers.
+ * -QAK */
+ /*if(shared->file->shared != f->shared)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "interfile hard links are not allowed")*/
/* Build the object location for the shared message's object header */
oloc.file = f;
@@ -579,7 +588,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst,
+H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst,
const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst,
hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata,
hid_t dxpl_id)
@@ -610,7 +619,7 @@ H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst,
/* Copy the shared object from source to destination */
dst_oloc.file = file_dst;
- src_oloc.file = shared_src->file;
+ src_oloc.file = file_src;
src_oloc.addr = shared_src->u.loc.oh_addr;
if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE,
NULL, NULL) < 0)