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>
doc: Fixes a typo in ceph-deploy man page.

Lack of a single space was restricting the proper rendering of an option in
html. Fixes the error.

Signed-off-by: Nilamdyuti Goswami <ngoswami@redhat.com>
doc: Adds updated ceph-deploy man page under man/

Signed-off-by: Nilamdyuti Goswami <ngoswami@redhat.com>
Merge pull request #3227 from nilamdyuti/wip-doc-ceph-deploy

Fixes a typo in ceph-deploy man page

Reviewed-by: Loic Dachary <ldachary@redhat.com>
osd/ReplicatedPG: set and invalidate data/omap digests on osd ops

When we create an empty object, we have a known digest of -1.  In a few
cases, we also know the digest from the op (e.g., writefull).  The rest
of the time we invalidate any existing digest.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: kill some dead scrub code

Signed-off-by: Sage Weil <sage@redhat.com>
osd/osd_types: add {data,omap}_digest to object_info_t

Also add flags to indicate whether the fields are valid.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: clean up scrub method debug output

Use __func__ instead of (usually inaccurate) names.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: drop vestigal invalid_snapcolls fields from scrub

This isn't used.  Snapcolls are ancient.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: use -1 for deep scrub digest seed on new OSDs

0 is a weak initial value for a CRC since it doesn't change with a sequence
of 0 bytes (which are relatively common).  -1 is better.  Use -1 when
everyone in the acting set supports it.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: remove more (most? all?) of classic scrub

Hopefully this is everything

Signed-off-by: Sage Weil <sage@redhat.com>
osd: move scrub no good auth check out of helper

This helps call out that this is an exceptional case and simplifies the
helper a bit.

Signed-off-by: Sage Weil <sage@redhat.com>