diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2018-06-08 09:43:40 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-06-14 15:49:02 +0000 |
commit | 52435b914e8e0e17b47d8679d86e2949d46c9228 (patch) | |
tree | d569266819bb921714b78a4043fd3cb0c4f2769e /xlators/features | |
parent | 2a3090028abc2bf76991c97b117d9a301de10344 (diff) |
features/snapview-server: properly go through the list of snapshots
The comparison code to check whether a glfs instance is valid
(i.e. whether it corresponds to one in the list of current snapshots)
was not correct and was not comparing all the snapshots
Change-Id: I87c58edb47bd9ebbb91d805e45df2c4baf2c8118
fixes: bz#1589842
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/snapview-server/src/snapview-server.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.h b/xlators/features/snapview-server/src/snapview-server.h index d776ed93a3a..bacb6275607 100644 --- a/xlators/features/snapview-server/src/snapview-server.h +++ b/xlators/features/snapview-server/src/snapview-server.h @@ -53,11 +53,14 @@ _private = this->private; \ int i = 0; \ gf_boolean_t found = _gf_false; \ + glfs_t *tmp_fs = NULL; \ LOCK (&_private->snaplist_lock); \ { \ for (i = 0; i < _private->num_snaps; i++) { \ - if (_private->dirents->fs && fs && \ - _private->dirents->fs == fs) { \ + tmp_fs = _private->dirents[i].fs; \ + gf_log (this->name, GF_LOG_DEBUG, \ + "dirent->fs: %p", tmp_fs); \ + if (tmp_fs && fs && (tmp_fs == fs)) { \ found = _gf_true; \ break; \ } \ @@ -65,8 +68,11 @@ } \ UNLOCK (&_private->snaplist_lock); \ \ - if (!found) \ + if (!found) { \ + gf_log (this->name, GF_LOG_WARNING, "failed to" \ + " find the fs instance %p", fs); \ fs = NULL; \ + } \ } while (0) #define SVS_GET_INODE_CTX_INFO(inode_ctx, fs, object, this, loc, ret, \ |