summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2017-01-24 14:18:03 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-01-26 22:04:40 -0500
commita3b4c70afee89536374f6fa032465cc313437956 (patch)
tree0aa5695ce7209920f245f34078f7e99458b06066 /xlators/performance
parent9e2d7faf598078d12a47512abae6792adbe01aca (diff)
performance/write-behind: do __wb_request_unref within locks
Since __wb_request_unref can remove the request from various lists, calling it without holding wb_inode->lock results in corruptions when other threads simultaneously try to access the lists this request is part of. Thanks to "Nithya Balachandran" <nbalacha@redhat.com> for pointing out the bug. Change-Id: I78fb6433c2e212500d07780f7b45c5a0e2bf9209 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: https://review.gluster.org/16464 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/write-behind/src/write-behind.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index cf8dd1f9e00..877d9217f5d 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1021,12 +1021,11 @@ wb_fulfill_short_write (wb_request_t *head, int size)
}
}
- }
done:
+ __wb_request_unref (head);
+ }
UNLOCK (&wb_inode->lock);
- __wb_request_unref (head);
-
wb_add_head_for_retry (req);
out:
return;