summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/performance/write-behind/src/write-behind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 67dd1f51ea1..2a2520147fe 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -964,6 +964,7 @@ __wb_fulfill_short_write (wb_request_t *req, int size, gf_boolean_t *fulfilled)
} else {
accounted_size = size;
__wb_modify_write_request (req, size);
+ *fulfilled = 0;
}
out:
@@ -1005,7 +1006,7 @@ wb_fulfill_short_write (wb_request_t *head, int size)
size -= accounted_size;
if (size == 0) {
- if (fulfilled)
+ if (fulfilled && (next != head))
req = next;
goto done;
@@ -1017,7 +1018,7 @@ wb_fulfill_short_write (wb_request_t *head, int size)
size -= accounted_size;
if (size == 0) {
- if (fulfilled)
+ if (fulfilled && (next != head))
req = next;
break;
}