From a3b4c70afee89536374f6fa032465cc313437956 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 24 Jan 2017 14:18:03 +0530 Subject: 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" for pointing out the bug. Change-Id: I78fb6433c2e212500d07780f7b45c5a0e2bf9209 Signed-off-by: Raghavendra G Reviewed-on: https://review.gluster.org/16464 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/performance/write-behind/src/write-behind.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xlators/performance/write-behind/src/write-behind.c') 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; -- cgit