Revert "client: invalidate kernel dentries one by one"

This reverts commit 491da5173fc33fec944865f0e2e9a506ec71fc5b.

Since 3.18 kernel, d_invalidate() unhash dentry even when it's
in use. If dentry of process' working directory is invalidated,
calling getcwd(3) will return -ENOENT.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: cleanup client callback registration

Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: use remount to trim kernel dcache

when remounting a file system, linux kernel trims all unused dentry
in the file system.

Fixes: #10277
Signed-off-by: Yan, Zheng <zyan@redhat.com>
SimpleMessenger: Retry binding on addresses if binding fails

If binding on a IP-Address fails, delay and retry again.

This happens mainly on IPv6 deployments. Due to DAD (Duplicate Address Detection)
or SLAAC it can be that IPv6 is not yet available when the daemons start.

Monitor daemons try to bind on a static IPv6 address and that might not be available
yet and that causes the monitor not to start.

Fixes: #10029
cls/refcount: ENOENT when put on non-existent object

If we get ENOENT, do not that that to mean an implicit reference count of
1.  That means that if you put a non-existent object, we should get
ENOENT instead of doing a useless delete on the OSD.

Note that this changes the get behavior slightly, too: doing a get on a
non-existent object will now fail with ENOENT instead of implicitly
creating it.

Stumbled across this from #10262.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: handle no-op write with snapshot case

If we have a transaction that does something to the object but it !exists
both before and after, we will continue through the write path.  If the
snapdir object already exists, and we try to create it again, we will
leak a snapdir obc and lock and later crash on an assert when the obc
is destroyed:

0> 2014-12-06 01:49:51.750163 7f08d6ade700 -1 osd/osd_types.h: In function 'ObjectContext::~ObjectContext()' thread 7f08d6ade700 time 2014-12-06 01:49:51.605411
osd/osd_types.h: 2944: FAILED assert(rwstate.empty())

Fix is to not recreated the snapdir if it already exists.

Fixes: #10262
Signed-off-by: Sage Weil <sage@redhat.com>
Cleanup: Drop hobject_incorrect_pool

This field in MOSDSubOp, used to support very old version
OSD(MOSDSubOp header version < 7, which was introduced in
mid 2012 by commit 2fe9816305fc1406ab7fb043bbb32affffc2d190)

Now since two years pasted, we don't need it anymore.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
osdc/Objecter: do notify completion callback in fast-dispatch context

The notify completion has exactly one user, the librados caller which
does nothing but take a local (inner) lock and signal a Cond.  Do this
in the fast-dispatch context for simplicity.

Notably, this makes the notify completion (and timeout) trigger a
notify2() return (with ETIMEDOUT) even when the finisher queue that
normally delivers notify is busy.. for example with a notify that is
being very slow.  In our case, the unit test is doing a sleep(3) to
test timeouts but also prevented the ETIMEDOUT notification from
being delivered to the caller.  This patch resolves that.

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #3121 from ceph/wip-10277

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
librados: add rados_watch_flush() call

Add a call so that callers can make sure all queued callbacks have
completed before shutting down the ioctx.  This avoids a segv triggered
by the LibRadosWatchNotifyPPTests/LibRadosWatchNotifyPP.WatchNotify2Timeout/1
test due to the ioctx being destroyed when the in-progress callback
does a notify_ack.

Signed-off-by: Sage Weil <sage@redhat.com>
librados: watch_flush() on shutdown

Users can easily forget this. It makes shutdown potentially block, but if
they have racing callbacks they get what they ask for.

Signed-off-by: Sage Weil <sage@redhat.com>
tests: remove spurious lines from osd-scrub-repair.sh

Signed-off-by: Loic Dachary <ldachary@redhat.com>
objectstore: add fadvise_flags operations in
ObjectStore::Transaction::append func.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
tests: recovery of a lost object in erasure coded pools

http://tracker.ceph.com/issues/10409 Refs: #10409

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: use port 7111 for osd-copy-from.sh

Because port 7110 is already used by mkfs.sh

Signed-off-by: Loic Dachary <ldachary@redhat.com>
remove unmatched op code comparasion

Signed-off-by: Dong Lei <leidong@yahoo-inc.com>
Merge pull request #3234 from majianpeng/bug-fix

objectstore: add fadvise_flags operations in ObjectStore::Transaction::append func.

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #3235 from dachary/wip-10410-port-7110

tests: use port 7111 for osd-copy-from.sh

Reviewed-by: Sage Weil <sage@redhat.com>
mon/PGMap: restructure 'pg stat' formatted output

The + character, which appears in state names, is not a valid XML token.

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #3230 from ceph/wip-pg-stat

mon/PGMap: restructure 'pg stat' formatted output

Reviewed-by: John Spray <jspray@redhat.com>