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