Bug 1313852 - Locks xl must use unique keys when filling in lock_count, dom_lock_count etc requested
Locks xl must use unique keys when filling in lock_count, dom_lock_count etc ...
Status: ASSIGNED
Product: GlusterFS
Classification: Community
Component: locks (Show other bugs)
mainline
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Krutika Dhananjay
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-02 07:55 EST by Krutika Dhananjay
Modified: 2016-03-02 07:55 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Krutika Dhananjay 2016-03-02 07:55:09 EST
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:

Note You need to log in before you can comment on or make changes to this bug.