diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-24 00:59:04 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-24 01:18:42 -0700 |
commit | c72b902afce2b977c8d0b9b1a0463f615365d825 (patch) | |
tree | f0376a4d2d8408e9e88fe3d8444acc996ea086b6 /xlators/performance/write-behind/src | |
parent | 155ffe5c5a52a8f52978dc68509e5912b5db7bc4 (diff) |
performance/write-behind: Add a NULL check for request->stub before checking request->stub->fop.
- for non-write wind requests, the request structure outlives the stub.
The call stub is destroyed when stack is wound but request is destroyed
only when the reply has come.
(for writes, both stub and request are destroyed when refcount becomes 0,
which happens only when the write operation is stack unwound and a reply
for the write operation has come from underlying translators, for non-write
unwind requests the request is first destroyed before resuming the stub).
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 280 (simple stripe, with write-behind set up, when dbench is run client crashes.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=280
Diffstat (limited to 'xlators/performance/write-behind/src')
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 622944b05b0..300d684659e 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1594,7 +1594,8 @@ __wb_collapse_write_bufs (list_head_t *requests, size_t page_size) wb_request_t *request = NULL, *tmp = NULL; list_for_each_entry_safe (request, tmp, requests, list) { - if ((request->stub->fop != GF_FOP_WRITE) + if ((request->stub == NULL) + || (request->stub->fop != GF_FOP_WRITE) || (request->flags.write_request.stack_wound)) { space_left = 0; ptr = NULL; |