<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/ceph/osd_client.h, branch v3.16.46</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.46</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.46'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-06-15T20:29:27Z</updated>
<entry>
<title>libceph: make authorizer destruction independent of ceph_auth_client</title>
<updated>2016-06-15T20:29:27Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-04-11T17:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5d740c28a3dc8ffb877d7ebcf2f07dd716aa47da'/>
<id>urn:sha1:5d740c28a3dc8ffb877d7ebcf2f07dd716aa47da</id>
<content type='text'>
commit 6c1ea260f89709e0021d2c59f8fd2a104b5b1123 upstream.

Starting the kernel client with cephx disabled and then enabling cephx
and restarting userspace daemons can result in a crash:

    [262671.478162] BUG: unable to handle kernel paging request at ffffebe000000000
    [262671.531460] IP: [&lt;ffffffff811cd04a&gt;] kfree+0x5a/0x130
    [262671.584334] PGD 0
    [262671.635847] Oops: 0000 [#1] SMP
    [262672.055841] CPU: 22 PID: 2961272 Comm: kworker/22:2 Not tainted 4.2.0-34-generic #39~14.04.1-Ubuntu
    [262672.162338] Hardware name: Dell Inc. PowerEdge R720/068CDY, BIOS 2.4.3 07/09/2014
    [262672.268937] Workqueue: ceph-msgr con_work [libceph]
    [262672.322290] task: ffff88081c2d0dc0 ti: ffff880149ae8000 task.ti: ffff880149ae8000
    [262672.428330] RIP: 0010:[&lt;ffffffff811cd04a&gt;]  [&lt;ffffffff811cd04a&gt;] kfree+0x5a/0x130
    [262672.535880] RSP: 0018:ffff880149aeba58  EFLAGS: 00010286
    [262672.589486] RAX: 000001e000000000 RBX: 0000000000000012 RCX: ffff8807e7461018
    [262672.695980] RDX: 000077ff80000000 RSI: ffff88081af2be04 RDI: 0000000000000012
    [262672.803668] RBP: ffff880149aeba78 R08: 0000000000000000 R09: 0000000000000000
    [262672.912299] R10: ffffebe000000000 R11: ffff880819a60e78 R12: ffff8800aec8df40
    [262673.021769] R13: ffffffffc035f70f R14: ffff8807e5b138e0 R15: ffff880da9785840
    [262673.131722] FS:  0000000000000000(0000) GS:ffff88081fac0000(0000) knlGS:0000000000000000
    [262673.245377] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [262673.303281] CR2: ffffebe000000000 CR3: 0000000001c0d000 CR4: 00000000001406e0
    [262673.417556] Stack:
    [262673.472943]  ffff880149aeba88 ffff88081af2be04 ffff8800aec8df40 ffff88081af2be04
    [262673.583767]  ffff880149aeba98 ffffffffc035f70f ffff880149aebac8 ffff8800aec8df00
    [262673.694546]  ffff880149aebac8 ffffffffc035c89e ffff8807e5b138e0 ffff8805b047f800
    [262673.805230] Call Trace:
    [262673.859116]  [&lt;ffffffffc035f70f&gt;] ceph_x_destroy_authorizer+0x1f/0x50 [libceph]
    [262673.968705]  [&lt;ffffffffc035c89e&gt;] ceph_auth_destroy_authorizer+0x3e/0x60 [libceph]
    [262674.078852]  [&lt;ffffffffc0352805&gt;] put_osd+0x45/0x80 [libceph]
    [262674.134249]  [&lt;ffffffffc035290e&gt;] remove_osd+0xae/0x140 [libceph]
    [262674.189124]  [&lt;ffffffffc0352aa3&gt;] __reset_osd+0x103/0x150 [libceph]
    [262674.243749]  [&lt;ffffffffc0354703&gt;] kick_requests+0x223/0x460 [libceph]
    [262674.297485]  [&lt;ffffffffc03559e2&gt;] ceph_osdc_handle_map+0x282/0x5e0 [libceph]
    [262674.350813]  [&lt;ffffffffc035022e&gt;] dispatch+0x4e/0x720 [libceph]
    [262674.403312]  [&lt;ffffffffc034bd91&gt;] try_read+0x3d1/0x1090 [libceph]
    [262674.454712]  [&lt;ffffffff810ab7c2&gt;] ? dequeue_entity+0x152/0x690
    [262674.505096]  [&lt;ffffffffc034cb1b&gt;] con_work+0xcb/0x1300 [libceph]
    [262674.555104]  [&lt;ffffffff8108fb3e&gt;] process_one_work+0x14e/0x3d0
    [262674.604072]  [&lt;ffffffff810901ea&gt;] worker_thread+0x11a/0x470
    [262674.652187]  [&lt;ffffffff810900d0&gt;] ? rescuer_thread+0x310/0x310
    [262674.699022]  [&lt;ffffffff810957a2&gt;] kthread+0xd2/0xf0
    [262674.744494]  [&lt;ffffffff810956d0&gt;] ? kthread_create_on_node+0x1c0/0x1c0
    [262674.789543]  [&lt;ffffffff817bd81f&gt;] ret_from_fork+0x3f/0x70
    [262674.834094]  [&lt;ffffffff810956d0&gt;] ? kthread_create_on_node+0x1c0/0x1c0

What happens is the following:

    (1) new MON session is established
    (2) old "none" ac is destroyed
    (3) new "cephx" ac is constructed
    ...
    (4) old OSD session (w/ "none" authorizer) is put
          ceph_auth_destroy_authorizer(ac, osd-&gt;o_auth.authorizer)

osd-&gt;o_auth.authorizer in the "none" case is just a bare pointer into
ac, which contains a single static copy for all services.  By the time
we get to (4), "none" ac, freed in (2), is long gone.  On top of that,
a new vtable installed in (3) points us at ceph_x_destroy_authorizer(),
so we end up trying to destroy a "none" authorizer with a "cephx"
destructor operating on invalid memory!

To fix this, decouple authorizer destruction from ac and do away with
a single static "none" authorizer by making a copy for each OSD or MDS
session.  Authorizers themselves are independent of ac and so there is
no reason for destroy_authorizer() to be an ac op.  Make it an op on
the authorizer itself by turning ceph_authorizer into a real struct.

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

Reported-by: Alan Zhang &lt;alan.zhang@linux.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
[bwh: Backported to 3.16:
 - Implementation of ceph_x_destroy_authorizer() is different
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>libceph: bump CEPH_OSD_MAX_OP to 3</title>
<updated>2014-04-03T02:33:52Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-02-25T14:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7cc69d42e6950404587bef9489a5ed6f9f6bab4e'/>
<id>urn:sha1:7cc69d42e6950404587bef9489a5ed6f9f6bab4e</id>
<content type='text'>
Our longest osd request now contains 3 ops: copyup+hint+write.

Also, CEPH_OSD_MAX_OP value in a BUG_ON in rbd_osd_req_callback() was
hard-coded to 2.  Fix it, and switch to rbd_assert while at it.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
</content>
</entry>
<entry>
<title>libceph: add support for CEPH_OSD_OP_SETALLOCHINT osd op</title>
<updated>2014-04-03T02:33:51Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-02-25T14:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c647b8a8c6366f849c2a237bfe525cb1d316d5f4'/>
<id>urn:sha1:c647b8a8c6366f849c2a237bfe525cb1d316d5f4</id>
<content type='text'>
This is primarily for rbd's benefit and is supposed to combat
fragmentation:

"... knowing that rbd images have a 4m size, librbd can pass a hint
that will let the osd do the xfs allocation size ioctl on new files so
that they are allocated in 1m or 4m chunks.  We've seen cases where
users with rbd workloads have very high levels of fragmentation in xfs
and this would mitigate that and probably have a pretty nice
performance benefit."

SETALLOCHINT is considered advisory, so our backwards compatibility
mechanism here is to set FAILOK flag for all SETALLOCHINT ops.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
</content>
</entry>
<entry>
<title>libceph: encode CEPH_OSD_OP_FLAG_* op flags</title>
<updated>2014-04-03T02:33:51Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-02-25T14:22:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b25bf5f02c5c80adf96120e031dc3a1756ce54d'/>
<id>urn:sha1:7b25bf5f02c5c80adf96120e031dc3a1756ce54d</id>
<content type='text'>
Encode ceph_osd_op::flags field so that it gets sent over the wire.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
</content>
</entry>
<entry>
<title>libceph: follow redirect replies from osds</title>
<updated>2014-01-27T21:57:53Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-01-27T15:40:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=205ee1187a671c3b067d7f1e974903b44036f270'/>
<id>urn:sha1:205ee1187a671c3b067d7f1e974903b44036f270</id>
<content type='text'>
Follow redirect replies from osds, for details see ceph.git commit
fbbe3ad1220799b7bb00ea30fce581c5eadaf034.

v1 (current) version of redirect reply consists of oloc and oid, which
expands to pool, key, nspace, hash and oid.  However, server-side code
that would populate anything other than pool doesn't exist yet, and
hence this commit adds support for pool redirects only.  To make sure
that future server-side updates don't break us, we decode all fields
and, if any of key, nspace, hash or oid have a non-default value, error
out with "corrupt osd_op_reply ..." message.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>libceph: rename ceph_osd_request::r_{oloc,oid} to r_base_{oloc,oid}</title>
<updated>2014-01-27T21:57:49Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-01-27T15:40:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3c972c95c68f455d80ff185aa440857be046bbe0'/>
<id>urn:sha1:3c972c95c68f455d80ff185aa440857be046bbe0</id>
<content type='text'>
Rename ceph_osd_request::r_{oloc,oid} to r_base_{oloc,oid} before
introducing r_target_{oloc,oid} needed for redirects.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>libceph: introduce and start using oid abstraction</title>
<updated>2014-01-27T21:57:28Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-01-27T15:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4295f2217a5aa8ef2738e3a368db3c1ceab41212'/>
<id>urn:sha1:4295f2217a5aa8ef2738e3a368db3c1ceab41212</id>
<content type='text'>
In preparation for tiering support, which would require having two
(base and target) object names for each osd request and also copying
those names around, introduce struct ceph_object_id (oid) and a couple
helpers to facilitate those copies and encapsulate the fact that object
name is not necessarily a NUL-terminated string.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>libceph: rename MAX_OBJ_NAME_SIZE to CEPH_MAX_OID_NAME_LEN</title>
<updated>2014-01-27T21:57:24Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-01-27T15:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2d0ebc5d591f49131bf8f93b54c5424162c3fb7f'/>
<id>urn:sha1:2d0ebc5d591f49131bf8f93b54c5424162c3fb7f</id>
<content type='text'>
In preparation for adding oid abstraction, rename MAX_OBJ_NAME_SIZE to
CEPH_MAX_OID_NAME_LEN.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>libceph: start using oloc abstraction</title>
<updated>2014-01-27T21:57:03Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>ilya.dryomov@inktank.com</email>
</author>
<published>2014-01-27T15:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=22116525baec1d63f4878eaa92f0b57946a78819'/>
<id>urn:sha1:22116525baec1d63f4878eaa92f0b57946a78819</id>
<content type='text'>
Instead of relying on pool fields in ceph_file_layout (for mapping) and
ceph_pg (for enconding), start using ceph_object_locator (oloc)
abstraction.  Note that userspace oloc currently consists of pool, key,
nspace and hash fields, while this one contains only a pool.  This is
OK, because at this point we only send (i.e. encode) olocs and never
have to receive (i.e. decode) them.

This makes keeping a copy of ceph_file_layout in every osd request
unnecessary, so ceph_osd_request::r_file_layout field is nuked.

Signed-off-by: Ilya Dryomov &lt;ilya.dryomov@inktank.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>libceph: block I/O when PAUSE or FULL osd map flags are set</title>
<updated>2013-12-13T17:13:29Z</updated>
<author>
<name>Josh Durgin</name>
<email>josh.durgin@inktank.com</email>
</author>
<published>2013-12-03T03:11:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d29adb34a94715174c88ca93e8aba955850c9bde'/>
<id>urn:sha1:d29adb34a94715174c88ca93e8aba955850c9bde</id>
<content type='text'>
The PAUSEWR and PAUSERD flags are meant to stop the cluster from
processing writes and reads, respectively. The FULL flag is set when
the cluster determines that it is out of space, and will no longer
process writes.  PAUSEWR and PAUSERD are purely client-side settings
already implemented in userspace clients. The osd does nothing special
with these flags.

When the FULL flag is set, however, the osd responds to all writes
with -ENOSPC. For cephfs, this makes sense, but for rbd the block
layer translates this into EIO.  If a cluster goes from full to
non-full quickly, a filesystem on top of rbd will not behave well,
since some writes succeed while others get EIO.

Fix this by blocking any writes when the FULL flag is set in the osd
client. This is the same strategy used by userspace, so apply it by
default.  A follow-on patch makes this configurable.

__map_request() is called to re-target osd requests in case the
available osds changed.  Add a paused field to a ceph_osd_request, and
set it whenever an appropriate osd map flag is set.  Avoid queueing
paused requests in __map_request(), but force them to be resent if
they become unpaused.

Also subscribe to the next osd map from the monitor if any of these
flags are set, so paused requests can be unblocked as soon as
possible.

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

Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
Signed-off-by: Josh Durgin &lt;josh.durgin@inktank.com&gt;
</content>
</entry>
</feed>
