summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2013-01-21 10:54:05 +0530
committerAnand Avati <avati@redhat.com>2013-02-07 14:41:32 -0800
commit32fff8967f10efa391815c06093086a9ee276762 (patch)
treebe5015311e0b00400196daf9c90ed7430c41ee3c
parent1206f652a08e7d3cb679b565ab73b3eebe28d247 (diff)
performance/quick-read: fix race condition in unlink
use same lock (inode->lock), while incrementing/decrementing local->open_count. Change-Id: I08cbab5b5dec09b6057f43324fe3152f1564ce46 BUG: 902174 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/4396 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/performance/quick-read/src/quick-read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 0e09a87..71fd2ab 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -3180,11 +3180,11 @@ qr_unlink_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
local = frame->local;
- LOCK (&local->lock);
+ LOCK (&loc->inode->lock);
{
open_count = --local->open_count;
}
- UNLOCK (&local->lock);
+ UNLOCK (&loc->inode->lock);
if (open_count > 0) {
goto out;