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