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