diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2019-07-02 16:50:23 -0400 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2019-07-24 11:03:57 +0000 |
commit | c52ceffa1a1df187d02c38ecbe3fe28267d58cf3 (patch) | |
tree | ae4667d4bab255d9b5044f3d251ca32e7a03db86 /xlators | |
parent | e58da08b8dd162109bc34138b13772e00ea8769e (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#1731512
(cherry picked from commit 8e795617fd6f5193d0d52a336059ce1a28108c0e)
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/snapview-server/src/snapview-server-mgmt.c | 2 |
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 17b3515e9a9..349c4f8d2d2 100644 --- a/xlators/features/snapview-server/src/snapview-server-mgmt.c +++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c @@ -256,7 +256,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; @@ -388,6 +387,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)) && |