summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2019-07-02 16:50:23 -0400
committerhari gowtham <hari.gowtham005@gmail.com>2019-08-01 10:45:16 +0000
commitf51491e684f79c87ee1f7b406f8c748d7e2bf8d7 (patch)
treeb762202963984e1d979ceb8b95496fe660b4e481
parent481c3c71c428c31ac84e2e1acf21b0ae07e4e32d (diff)
features/snapview-server: obtain the list of snapshots inside the lock
The current list of snapshots from priv->dirents is obtained outside the lock. Change-Id: I8876ec0a38308da5db058397382fbc82cc7ac177 Fixes: bz#1731509 (cherry picked from commit 8e795617fd6f5193d0d52a336059ce1a28108c0e)
-rw-r--r--xlators/features/snapview-server/src/snapview-server-mgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c
index b608cdfcd44..8fbf8e3e61b 100644
--- a/xlators/features/snapview-server/src/snapview-server-mgmt.c
+++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c
@@ -250,7 +250,6 @@ mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count,
this = frame->this;
ctx = frame->this->ctx;
priv = this->private;
- old_dirents = priv->dirents;
if (!ctx) {
errno = EINVAL;
@@ -382,6 +381,7 @@ mgmt_get_snapinfo_cbk(struct rpc_req *req, struct iovec *iov, int count,
LOCK(&priv->snaplist_lock);
{
oldcount = priv->num_snaps;
+ old_dirents = priv->dirents;
for (i = 0; i < priv->num_snaps; i++) {
for (j = 0; j < snapcount; j++) {
if ((!strcmp(old_dirents[i].name, dirents[j].name)) &&