[Bugs] [Bug 1313852] New: Locks xl must use unique keys when filling in lock_count, dom_lock_count etc requested

bugzilla at redhat.com bugzilla at redhat.com
Wed Mar 2 12:55:09 UTC 2016


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

            Bug ID: 1313852
           Summary: Locks xl must use unique keys when filling in
                    lock_count, dom_lock_count etc requested
           Product: GlusterFS
           Version: mainline
         Component: locks
          Keywords: Triaged
          Assignee: kdhananj at redhat.com
          Reporter: kdhananj at redhat.com
                CC: bugs at gluster.org



Description of problem:

12 void
 11 pl_set_xdata_response (xlator_t *this, pl_local_t *local, inode_t *parent,
 10                        inode_t *inode, char *name, dict_t *xdata)
  9 {
  8         if (!xdata || !local)
  7                 return;
  6
  5         if (local->parent_entrylk_req && parent && name && strlen (name))
  4                 pl_parent_entrylk_xattr_fill (this, parent, name, xdata);
  3
  2         if (local->entrylk_count_req && inode)
  1                 pl_entrylk_xattr_fill (this, inode, xdata);
0                                                                               
  1         if (local->inodelk_dom_count_req && inode)
  2                 pl_inodelk_xattr_fill (this, inode, xdata,
  3                                     data_to_str
(local->inodelk_dom_count_req));
  4
  5         if (local->inodelk_count_req && inode)
  6                 pl_inodelk_xattr_fill (this, inode, xdata, NULL);
  7
  8         if (local->posixlk_count_req && inode)
  9                 pl_posixlk_xattr_fill (this, inode, xdata);
 10 }                                                                           


  4 void
  5 pl_inodelk_xattr_fill (xlator_t *this, inode_t *inode, dict_t *dict,
  6                        char *domname)
  7 {
  8         int32_t     count = 0;
  9         int         ret   = -1;
 10
 11
 12         count = get_inodelk_count (this, inode, domname);
 13
 14         ret = dict_set_int32 (dict, GLUSTERFS_INODELK_COUNT, count);    
<====== bad, because the same key is used to set multiple requested options,
overwriting the previous value.
 15         if (ret < 0) {
 16                 gf_log (this->name, GF_LOG_DEBUG, "Failed to set count for
"
 17                         "key %s", GLUSTERFS_INODELK_COUNT);
 18         }
 19
 20         return;
 21 }


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.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=lOezM0u8PL&a=cc_unsubscribe


More information about the Bugs mailing list