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