qa/workunits/fs/misc: Add a workunit for ACL

Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: introduce a new flag indicating if dentries in directory are sorted

When creating a file, Client::insert_dentry_inode() set the dentry's offset
based on directory's max offset. The offset does not reflect the real
postion of the dentry in directory. Later readdir reply from real postion
of the dentry in directory. Later readdir reply from MDS may change the
dentry's position/offset. This inconsistency can cause missing/duplicate
entries in readdir result if readdir is partly satisfied by dcache_readdir().

The fix is introduce a new flag indicating if dentries in directory are
sorted. We use _readdir_cache_cb() to handle readdir only when the flag is
set, clear the flag after creating/deleting/renaming file.

Fixes: #9178
Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: preserve ordering of readdir result in cache

Preserve ordering of readdir result in a list, so that the result of cached
readdir is consistant with uncached readdir.

As a side effect, this commit also removes the code that removes stale dentries.
This is OK because stale dentries does not have valid lease, they will be
filter out by the shared gen check in Client::_readdir_cache_cb()

Signed-off-by: Yan, Zheng <zyan@redhat.com>
mon/Paxos: fix off-by-one in last_ vs first_committed check

peon last_committed + 1 == leader first_committed is okay.  Note that the
other check (where I clean up whitespace) gets this correct.

Fixes: #9301 (partly)
Signed-off-by: Sage Weil <sage@redhat.com>
mon: re-bootstrap if we get probed by a mon that is way ahead

During bootstrap we verify that our paxos commits overlap with the other
mons we will form a quorum with.  If they do not, we do a sync.

However, it is possible we pass those checks, then fail to join a quorum
before the quorum moves ahead in time such that we no longer overlap.
Currently nothing kicks up back into a probing state to discover we need
to sync... we will just keep trying to call or join an election instead.

Fix this by jumping back to bootstrap if we get a probe that is ahead of
us.  Only do this from non probe or sync states as these will be common;
it is only the active and electing states that matter (and probably just
electing!).

Fixes: #9301
Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2514 from ceph/wip-acl-test

qa/workunits/fs/misc: Add a workunit for ACL

Reviewed-by: Greg Farnum <greg@inktank.com>
common: Add cctid meta variable

Fixes: #6228
Signed-off-by: Adam Crume <adamcrume@gmail.com>
documentation: fix bugous osd stop/start example

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
documentation: tiering typo

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
documentation: explain ceph osd reweight vs crush weight

Using the wording from Gregory Farnum at
http://lists.ceph.com/pipermail/ceph-users-ceph.com/2014-June/040961.html

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Merge pull request #2536 from dachary/wip-doc-reweight

documentation: explain ceph osd reweight vs crush weight

Reviewed-by: Laurent Guerby <laurent@guerby.net>
test/librados/aio.cc: close resource leak

Release my_completion4.

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
LogEntry.h: init LogEntry::seq with 0

CID 1238904 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use_in_call: Using uninitialized value e.seq when calling
 log_to_syslog.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ErasureCodeLrc.h: fix data_chunk_count UNINIT_CTOR

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ErasureCodeLrc.h: fix UNINIT_CTOR

Fix Coverity issue, preinit with 0:

uninit_member: Non-static class member chunk_count is not initialized
 in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Beacon.*: fix UNINIT_CTOR cases

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/libradosstriper/striping.cc: remove dead initialization

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/kv_store_bench.cc: fix coverity REVERSE_INULL

CID 1021214 (#1 of 1): Dereference before null check (REVERSE_INULL)
 check_after_deref: Null-checking cb_args suggests that it may be
 null, but it has already been dereferenced on all paths leading to
 the check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
common/buffer.cc: catch exception by reference

CID 1135926 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Catching an exception object of size 264 bytes by value.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
os/GenericObjectMap.cc: pass big parameter by reference

CID 1188142 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
 pass_by_value: Passing parameter header of type
 GenericObjectMap::_Header (size 176 bytes) by value.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>