[Bugs] [Bug 1589842] New: [USS] snapview server does not go through the list of all the snapshots for validating a snap

bugzilla at redhat.com bugzilla at redhat.com
Mon Jun 11 13:49:48 UTC 2018


https://bugzilla.redhat.com/show_bug.cgi?id=1589842

            Bug ID: 1589842
           Summary: [USS] snapview server does not go through the list of
                    all the snapshots for validating a snap
           Product: GlusterFS
           Version: mainline
         Component: snapshot
          Assignee: bugs at gluster.org
          Reporter: rabhat at redhat.com
                CC: bugs at gluster.org



Description of problem:

Currently the snapview server from the snap daemon makes uses of gfapi to
communicate with individual snapshots. Each snapshot is represented by a glfs
instance. The inode context of each inode that snap daemon maintains, will have
the information about which glfs instance (i.e. which snapshot) does the inode
belongs to.

To compare whether a glfs instance is a valid glfs instance corresponding to
one of the snapshots, snapview server compares it with its list of snapshots.

But that macro has a bug and does not go through the list of all the snapshots
(or glfs instances corresponding to those snapshots), and just compares with
the 1st glfs instance always.


#define SVS_CHECK_VALID_SNAPSHOT_HANDLE(fs, this)                       \
        do {                                                            \
                svs_private_t *_private = NULL;                         \
                _private = this->private;                               \
                int  i = 0;                                             \
                gf_boolean_t found = _gf_false;                         \
                LOCK (&_private->snaplist_lock);                        \
                {                                                       \
                        for (i = 0; i < _private->num_snaps; i++) {     \
                                if (_private->dirents->fs && fs &&      \
                                    _private->dirents->fs == fs) {      \
                                        found = _gf_true;               \
                                        break;                          \
                                }                                       \
            }                                               \
                }                                                       \
                UNLOCK (&_private->snaplist_lock);                      \
                                                                        \
                if (!found)                                             \
                        fs = NULL;                                      \
        } while (0)



It should be

"
   if (_private->dirents->fs[i] && fs &&      \
       _private->dirents->fs[i] == fs) {      \
"

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list