diff options
Diffstat (limited to 'src/include/os_fhandle.i')
-rw-r--r-- | src/include/os_fhandle.i | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/include/os_fhandle.i b/src/include/os_fhandle.i index 06eef2b7e9c..78d25969508 100644 --- a/src/include/os_fhandle.i +++ b/src/include/os_fhandle.i @@ -18,8 +18,8 @@ __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block) WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->handle->name)); + __wt_verbose( + session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->handle->name); handle = fh->handle; /* @@ -50,9 +50,9 @@ __wt_fextend(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset) WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-extend: %" PRIuMAX " at %" PRIuMAX, - fh->handle->name, (uintmax_t)offset)); + fh->handle->name, (uintmax_t)offset); /* * Our caller is responsible for handling any locking issues, all we @@ -77,8 +77,8 @@ __wt_file_lock(WT_SESSION_IMPL * session, WT_FH *fh, bool lock) { WT_FILE_HANDLE *handle; - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, - "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock")); + __wt_verbose(session, WT_VERB_HANDLEOPS, + "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock"); handle = fh->handle; return (handle->fh_lock == NULL ? 0 : @@ -95,9 +95,9 @@ __wt_read( { WT_DECL_RET; - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-read: %" WT_SIZET_FMT " at %" PRIuMAX, - fh->handle->name, len, (uintmax_t)offset)); + fh->handle->name, len, (uintmax_t)offset); WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_read_active); WT_STAT_FAST_CONN_INCR(session, read_io); @@ -116,8 +116,8 @@ __wt_read( static inline int __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep) { - WT_RET(__wt_verbose( - session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name)); + __wt_verbose( + session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name); return (fh->handle->fh_size(fh->handle, (WT_SESSION *)session, sizep)); } @@ -133,9 +133,9 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset) WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY)); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-truncate: %" PRIuMAX " at %" PRIuMAX, - fh->handle->name, (uintmax_t)offset)); + fh->handle->name, (uintmax_t)offset); /* * Our caller is responsible for handling any locking issues, all we @@ -162,12 +162,19 @@ __wt_write(WT_SESSION_IMPL *session, WT_STRING_MATCH(fh->name, WT_SINGLETHREAD, strlen(WT_SINGLETHREAD))); - WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS, + __wt_verbose(session, WT_VERB_HANDLEOPS, "%s: handle-write: %" WT_SIZET_FMT " at %" PRIuMAX, - fh->handle->name, len, (uintmax_t)offset)); + fh->handle->name, len, (uintmax_t)offset); + + /* + * Do a final panic check before I/O, so we stop writing as quickly as + * possible if there's an unanticipated error. We aren't handling the + * error correctly by definition, and writing won't make things better. + */ + WT_RET(WT_SESSION_CHECK_PANIC(session)); - WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_write_active); WT_STAT_FAST_CONN_INCR(session, write_io); + WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_write_active); ret = fh->handle->fh_write( fh->handle, (WT_SESSION *)session, offset, len, buf); |