Skip to content

Fio objectstore - #1

Closed
jupiturliu wants to merge 18 commits into
cbodley:masterfrom
jupiturliu:fio-objectstore
Closed

jupiturliu wants to merge 18 commits into
cbodley:masterfrom
jupiturliu:fio-objectstore

Conversation

@jupiturliu

Copy link
Copy Markdown

No description provided.

gollub and others added 18 commits July 10, 2015 15:46
due to not third-party include-safe fio.h
add 'objectstore' option and use it for ObjectStore factory
remove the osdpath option, and just use 'directory' as the osd path.
add filestore_debug option
Suggested-by: James (Fei) Liu-SSI <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Nov 2, 2015

Copy link
Copy Markdown
Owner

@jupiturliu I'm having trouble telling what's different between this and my fio-objectstore branch. If you have changes you'd like included, could you please resubmit this pull request against cbodley:fio-objectstore?

@cbodley cbodley closed this Nov 2, 2015
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1316232 (#1 of 1): Unchecked dynamic_cast (FORWARD_NULL)
 dynamic_cast: Dynamic cast to pointer dynamic_cast <ReplicatedPG *>(this->get_parent())
  can return NULL.
 var_deref_model: Passing null pointer dynamic_cast <ReplicatedPG *>(this->get_parent())
  to is_undersized, which dereferences it.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1297882 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions ns and 1000000000UL, and then
 converting the integer quotient to type float. Any remainder, or fractional
 part of the quotient, is ignored.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1297883 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions this->cct->_conf->osd_heartbeat_grace
 and 2, and then converting the integer quotient to type double. Any remainder,
 or fractional part of the quotient, is ignored.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1322813 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member seq is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Remove unused variable 'CephContext *cct'.

Fix for:

CID 1322818 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member cct is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1296382 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable ckh going out of scope leaks the storage
 it points to.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1297867 (#1 of 1): Resource leak (RESOURCE_LEAK)
 alloc_arg: put_obj_init allocates memory that is stored into
  out_stream_req.
 leaked_storage: Variable out_stream_req going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
The allocated 'Formatter' passed to the function should be
freed by the caller to avoid missusage.

If handle_asok_command() free's the pointer to 'Formatter' to pass
an indication of an error back to the caller, it should have at least
set the pointer to NULL to work anyway.

Fix for:

CID 1316253 (#1 of 1): Use after free (USE_AFTER_FREE)
 deref_arg: Calling flush dereferences freed pointer f. (The dereference
 happens because this is a virtual function call.)

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 9, 2016
Fix for:

CID 1265562 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_handle: Handle variable sd going out of scope leaks the handle.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley added a commit that referenced this pull request Aug 24, 2016
the CephContextServiceThread (and AdminSocket thread) are both spawned
before global_init_daemonize() calls daemon() to fork the process

this means that the resources allocated for those threads will never be
cleaned up in the child. this includes a pthread_cond_t in
CephContextServiceThread, leading to undefined behavior in
pthread_cond_destroy() on shutdown that is detected by helgrind:

==18362== Thread #1: pthread_cond_destroy: destruction of condition variable being waited upon
==18362==    at 0x98FC915: pthread_cond_destroy_WRK (hg_intercepts.c:1586)
==18362==    by 0x98FFB93: pthread_cond_destroy@* (hg_intercepts.c:1604)
==18362==    by 0x66DC23: Cond::~Cond() (Cond.h:45)
==18362==    by 0x66E22D: CephContextServiceThread::~CephContextServiceThread() (ceph_context.cc:90)
==18362==    by 0x66E279: CephContextServiceThread::~CephContextServiceThread() (ceph_context.cc:90)
==18362==    by 0x66CF5D: CephContext::join_service_thread() (ceph_context.cc:652)
==18362==    by 0x66C1A1: CephContext::~CephContext() (ceph_context.cc:522)
==18362==    by 0x66CC59: CephContext::put() (ceph_context.cc:594)
==18362==    by 0x64ACC6: main (test_main.cc:25)

the end result is that we hang in pthread_cond_destroy() on shutdown,
and valgrind complains about memory leaks for everything else in
the CephContext

Fixes: http://tracker.ceph.com/issues/17108

Signed-off-by: Casey Bodley <[email protected]>
cbodley pushed a commit that referenced this pull request Nov 29, 2016
CID 1395650 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter noid of type ghobject_t (size 144 bytes) by value.

Signed-off-by: Sage Weil <[email protected]>
cbodley pushed a commit that referenced this pull request Nov 29, 2016
CID 1395658 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter noid of type ghobject_t (size 144 bytes) by value.

Signed-off-by: Sage Weil <[email protected]>
cbodley pushed a commit that referenced this pull request Nov 29, 2016
CID 1395137 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value ObjectStore::Transaction::OP_TRY_RENAME is not terminated by a 'break' statement.

Signed-off-by: Sage Weil <[email protected]>
cbodley pushed a commit that referenced this pull request Nov 29, 2016
CID 1396232 (#1 of 1): Non-virtual destructor (VIRTUAL_DTOR)
1. nonvirtual_dtor: Class librbd::<unnamed>::SafeTimerSingleton has a destructor and a pointer to it is upcast to class SafeTimer which doesn't have a virtual destructor.

The SafeTimerSingleton is not polymorphic; no need for
a virtual dtor.

Signed-off-by: Sage Weil <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 10, 2017
ID 1398895 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable config going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 10, 2017
Fix for:

CID 1395468 (#1 of 1): Self assignment (NO_EFFECT)
self_assign: Assigning bh->last_write to itself has no effect.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Feb 10, 2017
Some variables have been already free'd by calling
release(), no need to call delete() again on them.

CID 1396200 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 getxattr_completion which has already been freed.
CID 1396206 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 getxattr_completion which has already been freed.
CID 1396214 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 stat_completion which has already been freed.
CID 1396218 (#1 of 1): Double free (USE_AFTER_FREE)
 double_free: Calling operator delete frees pointer
 stat_completion which has already been freed.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Mar 8, 2017
Fixup for:

CID 1351687 (#1 of 1): Uninitialized scalar variable (UNINIT)
 var_decl: Declaring variable lock_type without initializer
 uninit_use: Using uninitialized value lock_type.

Signed-off-by: Danny Al-Gaaf <[email protected]>
(cherry picked from commit da9ede9)
cbodley pushed a commit that referenced this pull request Apr 12, 2017
Fix for:

CID 1396088 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396090 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396091 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396092 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396096 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396097 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396099 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396101 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396103 (#1 of 1): Uninitialized scalar variable (UNINIT)
CID 1396104 (#1 of 1): Uninitialized scalar variable (UNINIT)

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Apr 12, 2017
Addressed issue:

CID 1219611 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable saw_name going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Apr 12, 2017
Fix for:

CID 1395687 (#1 of 1): Resource leak (RESOURCE_LEAK)
CID 1395679 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable c going out of scope leaks the storage it
 points to.

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Apr 12, 2017
Fix for:

CID 1399581 (#1 of 1): Data race condition (MISSING_LOCK)
 missing_lock: Accessing this->state.atime without holding lock
 rgw::RGWFileHandle.mtx. Elsewhere, "_ZN3rgw13RGWFileHandle5StateE.atime"
 is accessed with rgw::RGWFileHandle.mtx held 2 out of 3 times
 (2 of these accesses strongly imply that it is necessary).

Signed-off-by: Danny Al-Gaaf <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 26, 2017
Fixes The Coverity Scan Report:
CID 1412577 (#1 of 1): Division or modulo by float zero (DIVIDE_BY_ZERO)
35. divide_by_zero: In expression (float)mk / k, division by expression k which may be zero has undefined behavior.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 26, 2017
Fixes the Coverity Scan Report:
CID 1411820 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
9. divide_by_zero: In expression bl.length() * i / sum, division by expression sum which may be zero has undefined behavior.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 28, 2017
Fixes the coverity scan report:
1412839 Uninitialized pointer field
CID 1412839 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static
class member array is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 28, 2017
…t::parse_option()

Fixes the Coverity Scan Report:
CID 1412776 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)19. var_deref_model: Passing null pointer option_name to operator <<, which dereferences it.

Fixed the review comments too in this commit.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 29, 2017
Fixes the Coverity Scan Report:
CID 1412617 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
3. uninit_member: Non-static class member field_aliases is not initialized in this constructor nor in any functions that it calls.
5. uninit_member: Non-static class member restricted_fields is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 29, 2017
Fixes the Coverity Scan Report:
CID 1412616 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member worker is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jun 29, 2017
Fixed the Coverity Scan Report:
CID 1412615 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member val is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jul 20, 2017
Fixes the Coverity Scan Report:
CID 1351737 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member worker is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jul 20, 2017
Fixes the Coverity Scan Report:
CID 1352180 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member field fs.rgw is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Jul 20, 2017
Fixes the Coverity Scan Report:
CID 1396146 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member max_objs is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member obj_names is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Jos Collin <[email protected]>
cbodley pushed a commit that referenced this pull request Aug 1, 2017
I'm seeing sporadic single thread deadlocks on fio stat_mutex during krbd
thrash runs:

  (gdb) info threads
    Id   Target Id         Frame
  * 1    Thread 0x7f89ee730740 (LWP 15604) 0x00007f89ed9f41bd in __lll_lock_wait () from /lib64/libpthread.so.0
  (gdb) bt
  #0  0x00007f89ed9f41bd in __lll_lock_wait () from /lib64/libpthread.so.0
  #1  0x00007f89ed9f17b2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  #2  0x00000000004429b9 in fio_mutex_down (mutex=0x7f89ee72d000) at mutex.c:170
  #3  0x0000000000459704 in thread_main (data=<optimized out>) at backend.c:1639
  #4  0x000000000045b013 in fork_main (offset=0, shmid=<optimized out>, sk_out=0x0) at backend.c:1778
  #5  run_threads (sk_out=sk_out@entry=0x0) at backend.c:2195
  #6  0x000000000045b47f in fio_backend (sk_out=sk_out@entry=0x0) at backend.c:2400
  #7  0x000000000040cb0c in main (argc=2, argv=0x7fffad3e3888, envp=<optimized out>) at fio.c:63
  (gdb) up 2
  170                     pthread_cond_wait(&mutex->cond, &mutex->lock);
  (gdb) p mutex.lock.__data.__owner
  $1 = 15604

Upgrading to 2.21 seems to make these go away.

Signed-off-by: Ilya Dryomov <[email protected]>
cbodley pushed a commit that referenced this pull request Aug 1, 2017
Fixed:

** CID 1409697 (#1 of 1): Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
1. assign_where_compare_meant: use of "=" where "==" may have been intended
2. primary_file: During compilation of file '/src/rgw/librgw.cc'

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 1, 2017
Fixed:

** CID 1351525 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
7. negative_returns: sd is passed to a parameter that cannot be negative.

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 1, 2017
Fixed:

** CID 1395347 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
3. negative_returns: fd is passed to a parameter that cannot be negative

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 14, 2017
Fixed:

** CID 1414508 (#1 of 1): Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
1. assign_where_compare_meant: use of "=" where "==" may have been intended

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 14, 2017
Fixed:

** CID 1403249 (#1 of 1): Uninitialized scalar variable (UNINIT)
6. uninit_use: Using uninitialized value snap_protected.

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 14, 2017
Fixed:

** CID 1402141 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member reopen is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar [email protected]
cbodley pushed a commit that referenced this pull request Aug 14, 2017
Fixed:

** CID 1402142 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member ops_allowance is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants