Bug 1313852 - Locks xl must use unique keys when filling in lock_count, dom_lock_count etc requested
Summary: Locks xl must use unique keys when filling in lock_count, dom_lock_count etc ...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: GlusterFS
Classification: Community
Component: locks
Version: mainline
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Krutika Dhananjay
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-02 12:55 UTC by Krutika Dhananjay
Modified: 2023-09-14 03:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-06 11:40:01 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Krutika Dhananjay 2016-03-02 12:55:09 UTC
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:

Comment 1 Yaniv Kaul 2019-04-22 14:04:37 UTC
Issue still seems to exist. Do we plan to fix it?

Comment 2 Krutika Dhananjay 2019-04-22 15:20:28 UTC
(In reply to Yaniv Kaul from comment #1)
> Issue still seems to exist. Do we plan to fix it?

That's true. The issue does still exist.

I need to check if there are any consumers today that will request multiple such counts as part of the same fop.
And then again, it also needs to be fixed in a backward-compatible way since the key-requesting translators will
be on the client side and their values are served by locks translator which sits on the server side.

I just found this while reading code and raised it a while ago. Let me check if we need this. Keeping the needinfo on me intact until then.

-Krutika

Comment 3 Krutika Dhananjay 2020-02-06 11:40:01 UTC
In the current scheme of things, this change won't be necessary. Closing the bz.

Comment 4 Red Hat Bugzilla 2023-09-14 03:18:48 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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