Fixes for more cppcheck issues#101
Fixes for more cppcheck issues#101dalgaaf wants to merge 30 commits intoceph:masterfrom dalgaaf:wip-da-sca-style-4
Conversation
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
…list Perform initialization of IntentLogNameFilter:prefix in initialization list instead of constructor body. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Don't compare unsigned maxfilelen against less than zero. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use ctx->ret() instead of bl.length() as return value. The length of bl can be checked by the caller, return status instead as already done in the other functions. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Return a string instead of 'char *' to avoid usage of std::string:c_str() to return a 'char *' from get_state_name() in mon/Monitor.h. Related warning from cppcheck: [src/mon/Monitor.h:172]: (error) Dangerous usage of c_str(). The value returned by c_str() is invalid after this call. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Prefer prefix ++operator for non-primitive types like iterators for performance reasons. Prefix ++/-- operators avoid creating a temporary copy. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
There was a problem hiding this comment.
I think these methods are marginally more efficient if they stay as const char *. Returning a const string is implicitly constructing a string object in memory, vs just returning a pointer to const text. In most cases the caller doesn't need the std::string.
There was a problem hiding this comment.
I changed it to return a string instead of char* due to usage of std::string::c_str() to return from get_state_name() in Monitor.h.
The problem with c_str() is that the result gets (may) invalid after the related string object gets destroyed or out of scope (which should be true on return). So you may get garbage in this case.
There was a problem hiding this comment.
Oh, I see. Yeah, that function should definitely be changed. The others that are just switches returning literal strings should stay const char *, though.
There was a problem hiding this comment.
Okay ... I will submit another pull request to fix only the issue in Monitor.h
|
Everything looks good, except for the fsx and get_state_name() patches. Care to resubmit with those ones dropped? |
Fixes for more cppcheck issues (v2 of #101) Reviewed-by: Sage Weil <sage@inktank.com>
…v2-rename-block_pool_to-rbd mgr/dashboard_v2: Renamed `block_pool` controller to `rbd`
* Fix for CORTX-28869:Unable to create IAM user with email * Enable create user for same UID under different Tenant with motr as backend. (ceph#90) Signed-off-by: Diwakar92 <diwakar.kumar@seagate.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> * rgw_sal_motr: [CORTX-28055] Support custom & multiple access/secret keys (ceph#93) * rgw_sal_motr: [CORTX-28055] Support custom & multiple access/secret keys Added support for multple key creation for a user which can be either custom or auto generated. Signed-off-by: Jeet Jain <jeet.jain@seagate.com> * rgw_sal_motr: [EOS-27516] Handling object overwrite during put-object (ceph#89) * rgw_sal_motr: [EOS-27516] handling object overwrite Deleting existing object data if same object is uploaded again to avoid object leak. Signed-off-by: saurabh jain <saurabh.jain2@seagate.com> * rgw_sal_motr: [EOS-27516] Handle parallel upload During parallel object upload, there are chances of object leak, which can be handled by making use of GC. Since GC is not being use for motr as of now, adding a TODO for the same. Signed-off-by: saurabh jain <saurabh.jain@seagate.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> * Rebase (ceph#88) Signed-off-by: Parayya Vastrad <parayya.vastrad@seagate.com> * merge conflicts * merge conflicts * Review comments addressed * Review comments addressed Co-authored-by: root <root@ssc-vm-g4-rhev4-0716.colo.seagate.com> Co-authored-by: Diwakar92 <96409310+Diwakar92@users.noreply.github.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> Co-authored-by: Jeet Jain <jeet.jain@seagate.com> Co-authored-by: Saurabh Jain <91066893+sjain09@users.noreply.github.com> Co-authored-by: Parayya Vastrad <56255712+vastradparayya@users.noreply.github.com>
* Fix for CORTX-28869:Unable to create IAM user with email * Enable create user for same UID under different Tenant with motr as backend. (ceph#90) Signed-off-by: Diwakar92 <diwakar.kumar@seagate.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> * rgw_sal_motr: [CORTX-28055] Support custom & multiple access/secret keys (ceph#93) * rgw_sal_motr: [CORTX-28055] Support custom & multiple access/secret keys Added support for multple key creation for a user which can be either custom or auto generated. Signed-off-by: Jeet Jain <jeet.jain@seagate.com> * rgw_sal_motr: [EOS-27516] Handling object overwrite during put-object (ceph#89) * rgw_sal_motr: [EOS-27516] handling object overwrite Deleting existing object data if same object is uploaded again to avoid object leak. Signed-off-by: saurabh jain <saurabh.jain2@seagate.com> * rgw_sal_motr: [EOS-27516] Handle parallel upload During parallel object upload, there are chances of object leak, which can be handled by making use of GC. Since GC is not being use for motr as of now, adding a TODO for the same. Signed-off-by: saurabh jain <saurabh.jain@seagate.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> * Rebase (ceph#88) Signed-off-by: Parayya Vastrad <parayya.vastrad@seagate.com> * merge conflicts * merge conflicts * Review comments addressed * Review comments addressed Co-authored-by: root <root@ssc-vm-g4-rhev4-0716.colo.seagate.com> Co-authored-by: Diwakar92 <96409310+Diwakar92@users.noreply.github.com> Co-authored-by: kupranay <66459168+kupranay@users.noreply.github.com> Co-authored-by: Jeet Jain <jeet.jain@seagate.com> Co-authored-by: Saurabh Jain <91066893+sjain09@users.noreply.github.com> Co-authored-by: Parayya Vastrad <56255712+vastradparayya@users.noreply.github.com>
User email index is not present. Created user index and add user email entry in the email index in it. Signed-off-by: Sanal Kaarthikeyan <sanal.kaarthikeyan@seagate.com>
Support not between operator expression [NOT] between expression AND expression Signed-off-by: Albin Antony <aantony@redhat.com>
These commits address issues like: