|
|
d1681e |
From c4ce2bb15a9df0a1b6a999612ccd053e67dc7083 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
d1681e |
Date: Mon, 19 Mar 2018 12:09:18 +0530
|
|
|
d1681e |
Subject: [PATCH 187/201] features/shard: Do list_del_init() while list memory
|
|
|
d1681e |
is valid
|
|
|
d1681e |
|
|
|
d1681e |
Problem:
|
|
|
d1681e |
shard_post_lookup_fsync_handler() goes over the list of inode-ctx that need to
|
|
|
d1681e |
be fsynced and in cbk it removes each of the inode-ctx from the list. When the
|
|
|
d1681e |
first member of list is removed it tries to modifies list head's memory with
|
|
|
d1681e |
the latest next/prev and when this happens, there is no guarantee that the
|
|
|
d1681e |
list-head which is from stack memory of shard_post_lookup_fsync_handler() is
|
|
|
d1681e |
valid.
|
|
|
d1681e |
|
|
|
d1681e |
Fix:
|
|
|
d1681e |
Do list_del_init() in the loop before winding fsync.
|
|
|
d1681e |
|
|
|
d1681e |
>BUG: 1557876
|
|
|
d1681e |
>Change-Id: If429d3634219e1a435bd0da0ed985c646c59c2ca
|
|
|
d1681e |
>Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
d1681e |
|
|
|
d1681e |
Upstream-patch: https://review.gluster.org/19737
|
|
|
d1681e |
BUG: 1556895
|
|
|
d1681e |
Change-Id: If429d3634219e1a435bd0da0ed985c646c59c2ca
|
|
|
d1681e |
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/133241
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/features/shard/src/shard.c | 2 +-
|
|
|
d1681e |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
|
|
|
d1681e |
index a661345..945458e 100644
|
|
|
d1681e |
--- a/xlators/features/shard/src/shard.c
|
|
|
d1681e |
+++ b/xlators/features/shard/src/shard.c
|
|
|
d1681e |
@@ -4521,7 +4521,6 @@ out:
|
|
|
d1681e |
if (op_ret == 0)
|
|
|
d1681e |
ctx->fsync_needed -= fsync_count;
|
|
|
d1681e |
GF_ASSERT (ctx->fsync_needed >= 0);
|
|
|
d1681e |
- list_del_init (&ctx->to_fsync_list);
|
|
|
d1681e |
if (ctx->fsync_needed != 0) {
|
|
|
d1681e |
list_add_tail (&ctx->to_fsync_list,
|
|
|
d1681e |
&base_ictx->to_fsync_list);
|
|
|
d1681e |
@@ -4596,6 +4595,7 @@ shard_post_lookup_fsync_handler (call_frame_t *frame, xlator_t *this)
|
|
|
d1681e |
anon_fd = NULL;
|
|
|
d1681e |
|
|
|
d1681e |
list_for_each_entry_safe (iter, tmp, ©, to_fsync_list) {
|
|
|
d1681e |
+ list_del_init (&iter->to_fsync_list);
|
|
|
d1681e |
fsync_count = 0;
|
|
|
d1681e |
shard_inode_ctx_get_fsync_count (iter->inode, this,
|
|
|
d1681e |
&fsync_count);
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|