14f8ab
From 659bd2a0fde9ba0cb8fc3905bcdb63d91e3dfa9d Mon Sep 17 00:00:00 2001
14f8ab
From: Raghavendra Bhat <raghavendra@redhat.com>
14f8ab
Date: Tue, 2 Jul 2019 16:50:23 -0400
14f8ab
Subject: [PATCH 319/335] features/snapview-server: obtain the list of
14f8ab
 snapshots inside the lock
14f8ab
14f8ab
The current list of snapshots from priv->dirents is obtained outside
14f8ab
the lock.
14f8ab
14f8ab
Upstream patch:
14f8ab
> Change-Id: I8876ec0a38308da5db058397382fbc82cc7ac177
14f8ab
> Fixes: bz#1726783
14f8ab
> Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
14f8ab
> patch: https://review.gluster.org/#/c/glusterfs/+/22990/
14f8ab
14f8ab
BUG: 1731513
14f8ab
Change-Id: I8876ec0a38308da5db058397382fbc82cc7ac177
14f8ab
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
14f8ab
Reviewed-on: https://code.engineering.redhat.com/gerrit/185838
14f8ab
Tested-by: RHGS Build Bot <nigelb@redhat.com>
14f8ab
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
14f8ab
---
14f8ab
 xlators/features/snapview-server/src/snapview-server-mgmt.c | 2 +-
14f8ab
 1 file changed, 1 insertion(+), 1 deletion(-)
14f8ab
14f8ab
diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c
14f8ab
index bc415ef..3d64383 100644
14f8ab
--- a/xlators/features/snapview-server/src/snapview-server-mgmt.c
14f8ab
+++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c
14f8ab
@@ -256,7 +256,6 @@ mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count,
14f8ab
     this = frame->this;
14f8ab
     ctx = frame->this->ctx;
14f8ab
     priv = this->private;
14f8ab
-    old_dirents = priv->dirents;
14f8ab
 
14f8ab
     if (!ctx) {
14f8ab
         errno = EINVAL;
14f8ab
@@ -388,6 +387,7 @@ mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count,
14f8ab
     LOCK(&priv->snaplist_lock);
14f8ab
     {
14f8ab
         oldcount = priv->num_snaps;
14f8ab
+        old_dirents = priv->dirents;
14f8ab
         for (i = 0; i < priv->num_snaps; i++) {
14f8ab
             for (j = 0; j < snapcount; j++) {
14f8ab
                 if ((!strcmp(old_dirents[i].name, dirents[j].name)) &&
14f8ab
-- 
14f8ab
1.8.3.1
14f8ab