<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/ceph, branch v4.9.28</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>libceph: force GFP_NOIO for socket allocations</title>
<updated>2017-04-08T07:30:30+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2017-03-21T12:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8601537724611b724920fd397cc9fdb181e92ed3'/>
<id>8601537724611b724920fd397cc9fdb181e92ed3</id>
<content type='text'>
commit 633ee407b9d15a75ac9740ba9d3338815e1fcb95 upstream.

sock_alloc_inode() allocates socket+inode and socket_wq with
GFP_KERNEL, which is not allowed on the writeback path:

    Workqueue: ceph-msgr con_work [libceph]
    ffff8810871cb018 0000000000000046 0000000000000000 ffff881085d40000
    0000000000012b00 ffff881025cad428 ffff8810871cbfd8 0000000000012b00
    ffff880102fc1000 ffff881085d40000 ffff8810871cb038 ffff8810871cb148
    Call Trace:
    [&lt;ffffffff816dd629&gt;] schedule+0x29/0x70
    [&lt;ffffffff816e066d&gt;] schedule_timeout+0x1bd/0x200
    [&lt;ffffffff81093ffc&gt;] ? ttwu_do_wakeup+0x2c/0x120
    [&lt;ffffffff81094266&gt;] ? ttwu_do_activate.constprop.135+0x66/0x70
    [&lt;ffffffff816deb5f&gt;] wait_for_completion+0xbf/0x180
    [&lt;ffffffff81097cd0&gt;] ? try_to_wake_up+0x390/0x390
    [&lt;ffffffff81086335&gt;] flush_work+0x165/0x250
    [&lt;ffffffff81082940&gt;] ? worker_detach_from_pool+0xd0/0xd0
    [&lt;ffffffffa03b65b1&gt;] xlog_cil_force_lsn+0x81/0x200 [xfs]
    [&lt;ffffffff816d6b42&gt;] ? __slab_free+0xee/0x234
    [&lt;ffffffffa03b4b1d&gt;] _xfs_log_force_lsn+0x4d/0x2c0 [xfs]
    [&lt;ffffffff811adc1e&gt;] ? lookup_page_cgroup_used+0xe/0x30
    [&lt;ffffffffa039a723&gt;] ? xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa03b4dcf&gt;] xfs_log_force_lsn+0x3f/0xf0 [xfs]
    [&lt;ffffffffa039a723&gt;] ? xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa03a62c6&gt;] xfs_iunpin_wait+0xc6/0x1a0 [xfs]
    [&lt;ffffffff810aa250&gt;] ? wake_atomic_t_function+0x40/0x40
    [&lt;ffffffffa039a723&gt;] xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa039ac07&gt;] xfs_reclaim_inodes_ag+0x257/0x3d0 [xfs]
    [&lt;ffffffffa039bb13&gt;] xfs_reclaim_inodes_nr+0x33/0x40 [xfs]
    [&lt;ffffffffa03ab745&gt;] xfs_fs_free_cached_objects+0x15/0x20 [xfs]
    [&lt;ffffffff811c0c18&gt;] super_cache_scan+0x178/0x180
    [&lt;ffffffff8115912e&gt;] shrink_slab_node+0x14e/0x340
    [&lt;ffffffff811afc3b&gt;] ? mem_cgroup_iter+0x16b/0x450
    [&lt;ffffffff8115af70&gt;] shrink_slab+0x100/0x140
    [&lt;ffffffff8115e425&gt;] do_try_to_free_pages+0x335/0x490
    [&lt;ffffffff8115e7f9&gt;] try_to_free_pages+0xb9/0x1f0
    [&lt;ffffffff816d56e4&gt;] ? __alloc_pages_direct_compact+0x69/0x1be
    [&lt;ffffffff81150cba&gt;] __alloc_pages_nodemask+0x69a/0xb40
    [&lt;ffffffff8119743e&gt;] alloc_pages_current+0x9e/0x110
    [&lt;ffffffff811a0ac5&gt;] new_slab+0x2c5/0x390
    [&lt;ffffffff816d71c4&gt;] __slab_alloc+0x33b/0x459
    [&lt;ffffffff815b906d&gt;] ? sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff8164bda1&gt;] ? inet_sendmsg+0x71/0xc0
    [&lt;ffffffff815b906d&gt;] ? sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff811a21f2&gt;] kmem_cache_alloc+0x1a2/0x1b0
    [&lt;ffffffff815b906d&gt;] sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff811d8566&gt;] alloc_inode+0x26/0xa0
    [&lt;ffffffff811da04a&gt;] new_inode_pseudo+0x1a/0x70
    [&lt;ffffffff815b933e&gt;] sock_alloc+0x1e/0x80
    [&lt;ffffffff815ba855&gt;] __sock_create+0x95/0x220
    [&lt;ffffffff815baa04&gt;] sock_create_kern+0x24/0x30
    [&lt;ffffffffa04794d9&gt;] con_work+0xef9/0x2050 [libceph]
    [&lt;ffffffffa04aa9ec&gt;] ? rbd_img_request_submit+0x4c/0x60 [rbd]
    [&lt;ffffffff81084c19&gt;] process_one_work+0x159/0x4f0
    [&lt;ffffffff8108561b&gt;] worker_thread+0x11b/0x530
    [&lt;ffffffff81085500&gt;] ? create_worker+0x1d0/0x1d0
    [&lt;ffffffff8108b6f9&gt;] kthread+0xc9/0xe0
    [&lt;ffffffff8108b630&gt;] ? flush_kthread_worker+0x90/0x90
    [&lt;ffffffff816e1b98&gt;] ret_from_fork+0x58/0x90
    [&lt;ffffffff8108b630&gt;] ? flush_kthread_worker+0x90/0x90

Use memalloc_noio_{save,restore}() to temporarily force GFP_NOIO here.

Link: http://tracker.ceph.com/issues/19309
Reported-by: Sergey Jerusalimov &lt;wintchester@gmail.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 633ee407b9d15a75ac9740ba9d3338815e1fcb95 upstream.

sock_alloc_inode() allocates socket+inode and socket_wq with
GFP_KERNEL, which is not allowed on the writeback path:

    Workqueue: ceph-msgr con_work [libceph]
    ffff8810871cb018 0000000000000046 0000000000000000 ffff881085d40000
    0000000000012b00 ffff881025cad428 ffff8810871cbfd8 0000000000012b00
    ffff880102fc1000 ffff881085d40000 ffff8810871cb038 ffff8810871cb148
    Call Trace:
    [&lt;ffffffff816dd629&gt;] schedule+0x29/0x70
    [&lt;ffffffff816e066d&gt;] schedule_timeout+0x1bd/0x200
    [&lt;ffffffff81093ffc&gt;] ? ttwu_do_wakeup+0x2c/0x120
    [&lt;ffffffff81094266&gt;] ? ttwu_do_activate.constprop.135+0x66/0x70
    [&lt;ffffffff816deb5f&gt;] wait_for_completion+0xbf/0x180
    [&lt;ffffffff81097cd0&gt;] ? try_to_wake_up+0x390/0x390
    [&lt;ffffffff81086335&gt;] flush_work+0x165/0x250
    [&lt;ffffffff81082940&gt;] ? worker_detach_from_pool+0xd0/0xd0
    [&lt;ffffffffa03b65b1&gt;] xlog_cil_force_lsn+0x81/0x200 [xfs]
    [&lt;ffffffff816d6b42&gt;] ? __slab_free+0xee/0x234
    [&lt;ffffffffa03b4b1d&gt;] _xfs_log_force_lsn+0x4d/0x2c0 [xfs]
    [&lt;ffffffff811adc1e&gt;] ? lookup_page_cgroup_used+0xe/0x30
    [&lt;ffffffffa039a723&gt;] ? xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa03b4dcf&gt;] xfs_log_force_lsn+0x3f/0xf0 [xfs]
    [&lt;ffffffffa039a723&gt;] ? xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa03a62c6&gt;] xfs_iunpin_wait+0xc6/0x1a0 [xfs]
    [&lt;ffffffff810aa250&gt;] ? wake_atomic_t_function+0x40/0x40
    [&lt;ffffffffa039a723&gt;] xfs_reclaim_inode+0xa3/0x330 [xfs]
    [&lt;ffffffffa039ac07&gt;] xfs_reclaim_inodes_ag+0x257/0x3d0 [xfs]
    [&lt;ffffffffa039bb13&gt;] xfs_reclaim_inodes_nr+0x33/0x40 [xfs]
    [&lt;ffffffffa03ab745&gt;] xfs_fs_free_cached_objects+0x15/0x20 [xfs]
    [&lt;ffffffff811c0c18&gt;] super_cache_scan+0x178/0x180
    [&lt;ffffffff8115912e&gt;] shrink_slab_node+0x14e/0x340
    [&lt;ffffffff811afc3b&gt;] ? mem_cgroup_iter+0x16b/0x450
    [&lt;ffffffff8115af70&gt;] shrink_slab+0x100/0x140
    [&lt;ffffffff8115e425&gt;] do_try_to_free_pages+0x335/0x490
    [&lt;ffffffff8115e7f9&gt;] try_to_free_pages+0xb9/0x1f0
    [&lt;ffffffff816d56e4&gt;] ? __alloc_pages_direct_compact+0x69/0x1be
    [&lt;ffffffff81150cba&gt;] __alloc_pages_nodemask+0x69a/0xb40
    [&lt;ffffffff8119743e&gt;] alloc_pages_current+0x9e/0x110
    [&lt;ffffffff811a0ac5&gt;] new_slab+0x2c5/0x390
    [&lt;ffffffff816d71c4&gt;] __slab_alloc+0x33b/0x459
    [&lt;ffffffff815b906d&gt;] ? sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff8164bda1&gt;] ? inet_sendmsg+0x71/0xc0
    [&lt;ffffffff815b906d&gt;] ? sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff811a21f2&gt;] kmem_cache_alloc+0x1a2/0x1b0
    [&lt;ffffffff815b906d&gt;] sock_alloc_inode+0x2d/0xd0
    [&lt;ffffffff811d8566&gt;] alloc_inode+0x26/0xa0
    [&lt;ffffffff811da04a&gt;] new_inode_pseudo+0x1a/0x70
    [&lt;ffffffff815b933e&gt;] sock_alloc+0x1e/0x80
    [&lt;ffffffff815ba855&gt;] __sock_create+0x95/0x220
    [&lt;ffffffff815baa04&gt;] sock_create_kern+0x24/0x30
    [&lt;ffffffffa04794d9&gt;] con_work+0xef9/0x2050 [libceph]
    [&lt;ffffffffa04aa9ec&gt;] ? rbd_img_request_submit+0x4c/0x60 [rbd]
    [&lt;ffffffff81084c19&gt;] process_one_work+0x159/0x4f0
    [&lt;ffffffff8108561b&gt;] worker_thread+0x11b/0x530
    [&lt;ffffffff81085500&gt;] ? create_worker+0x1d0/0x1d0
    [&lt;ffffffff8108b6f9&gt;] kthread+0xc9/0xe0
    [&lt;ffffffff8108b630&gt;] ? flush_kthread_worker+0x90/0x90
    [&lt;ffffffff816e1b98&gt;] ret_from_fork+0x58/0x90
    [&lt;ffffffff8108b630&gt;] ? flush_kthread_worker+0x90/0x90

Use memalloc_noio_{save,restore}() to temporarily force GFP_NOIO here.

Link: http://tracker.ceph.com/issues/19309
Reported-by: Sergey Jerusalimov &lt;wintchester@gmail.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: don't set weight to IN when OSD is destroyed</title>
<updated>2017-03-30T07:41:27+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2017-03-01T16:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=81ec3dc1de0af47a4f38a276f68f55f4e7e8e621'/>
<id>81ec3dc1de0af47a4f38a276f68f55f4e7e8e621</id>
<content type='text'>
commit b581a5854eee4b7851dedb0f8c2ceb54fb902c06 upstream.

Since ceph.git commit 4e28f9e63644 ("osd/OSDMap: clear osd_info,
osd_xinfo on osd deletion"), weight is set to IN when OSD is deleted.
This changes the result of applying an incremental for clients, not
just OSDs.  Because CRUSH computations are obviously affected,
pre-4e28f9e63644 servers disagree with post-4e28f9e63644 clients on
object placement, resulting in misdirected requests.

Mirrors ceph.git commit a6009d1039a55e2c77f431662b3d6cc5a8e8e63f.

Fixes: 930c53286977 ("libceph: apply new_state before new_up_client on incrementals")
Link: http://tracker.ceph.com/issues/19122
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b581a5854eee4b7851dedb0f8c2ceb54fb902c06 upstream.

Since ceph.git commit 4e28f9e63644 ("osd/OSDMap: clear osd_info,
osd_xinfo on osd deletion"), weight is set to IN when OSD is deleted.
This changes the result of applying an incremental for clients, not
just OSDs.  Because CRUSH computations are obviously affected,
pre-4e28f9e63644 servers disagree with post-4e28f9e63644 clients on
object placement, resulting in misdirected requests.

Mirrors ceph.git commit a6009d1039a55e2c77f431662b3d6cc5a8e8e63f.

Fixes: 930c53286977 ("libceph: apply new_state before new_up_client on incrementals")
Link: http://tracker.ceph.com/issues/19122
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: update readpages osd request according to size of pages</title>
<updated>2017-03-12T05:41:53+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2017-01-19T03:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dc8470f3c831c93ffcda17612e8e58a73210b88b'/>
<id>dc8470f3c831c93ffcda17612e8e58a73210b88b</id>
<content type='text'>
commit d641df819db8b80198fd85d9de91137e8a823b07 upstream.

add_to_page_cache_lru() can fails, so the actual pages to read
can be smaller than the initial size of osd request. We need to
update osd request size in that case.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d641df819db8b80198fd85d9de91137e8a823b07 upstream.

add_to_page_cache_lru() can fails, so the actual pages to read
can be smaller than the initial size of osd request. We need to
update osd request size in that case.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: stop allocating a new cipher on every crypto request</title>
<updated>2017-01-26T07:24:46+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f77ef5348d4bfb498062930bd9af828f3ef2947e'/>
<id>f77ef5348d4bfb498062930bd9af828f3ef2947e</id>
<content type='text'>
commit 7af3ea189a9a13f090de51c97f676215dabc1205 upstream.

This is useless and more importantly not allowed on the writeback path,
because crypto_alloc_skcipher() allocates memory with GFP_KERNEL, which
can recurse back into the filesystem:

    kworker/9:3     D ffff92303f318180     0 20732      2 0x00000080
    Workqueue: ceph-msgr ceph_con_workfn [libceph]
     ffff923035dd4480 ffff923038f8a0c0 0000000000000001 000000009eb27318
     ffff92269eb28000 ffff92269eb27338 ffff923036b145ac ffff923035dd4480
     00000000ffffffff ffff923036b145b0 ffffffff951eb4e1 ffff923036b145a8
    Call Trace:
     [&lt;ffffffff951eb4e1&gt;] ? schedule+0x31/0x80
     [&lt;ffffffff951eb77a&gt;] ? schedule_preempt_disabled+0xa/0x10
     [&lt;ffffffff951ed1f4&gt;] ? __mutex_lock_slowpath+0xb4/0x130
     [&lt;ffffffff951ed28b&gt;] ? mutex_lock+0x1b/0x30
     [&lt;ffffffffc0a974b3&gt;] ? xfs_reclaim_inodes_ag+0x233/0x2d0 [xfs]
     [&lt;ffffffff94d92ba5&gt;] ? move_active_pages_to_lru+0x125/0x270
     [&lt;ffffffff94f2b985&gt;] ? radix_tree_gang_lookup_tag+0xc5/0x1c0
     [&lt;ffffffff94dad0f3&gt;] ? __list_lru_walk_one.isra.3+0x33/0x120
     [&lt;ffffffffc0a98331&gt;] ? xfs_reclaim_inodes_nr+0x31/0x40 [xfs]
     [&lt;ffffffff94e05bfe&gt;] ? super_cache_scan+0x17e/0x190
     [&lt;ffffffff94d919f3&gt;] ? shrink_slab.part.38+0x1e3/0x3d0
     [&lt;ffffffff94d9616a&gt;] ? shrink_node+0x10a/0x320
     [&lt;ffffffff94d96474&gt;] ? do_try_to_free_pages+0xf4/0x350
     [&lt;ffffffff94d967ba&gt;] ? try_to_free_pages+0xea/0x1b0
     [&lt;ffffffff94d863bd&gt;] ? __alloc_pages_nodemask+0x61d/0xe60
     [&lt;ffffffff94ddf42d&gt;] ? cache_grow_begin+0x9d/0x560
     [&lt;ffffffff94ddfb88&gt;] ? fallback_alloc+0x148/0x1c0
     [&lt;ffffffff94ed84e7&gt;] ? __crypto_alloc_tfm+0x37/0x130
     [&lt;ffffffff94de09db&gt;] ? __kmalloc+0x1eb/0x580
     [&lt;ffffffffc09fe2db&gt;] ? crush_choose_firstn+0x3eb/0x470 [libceph]
     [&lt;ffffffff94ed84e7&gt;] ? __crypto_alloc_tfm+0x37/0x130
     [&lt;ffffffff94ed9c19&gt;] ? crypto_spawn_tfm+0x39/0x60
     [&lt;ffffffffc08b30a3&gt;] ? crypto_cbc_init_tfm+0x23/0x40 [cbc]
     [&lt;ffffffff94ed857c&gt;] ? __crypto_alloc_tfm+0xcc/0x130
     [&lt;ffffffff94edcc23&gt;] ? crypto_skcipher_init_tfm+0x113/0x180
     [&lt;ffffffff94ed7cc3&gt;] ? crypto_create_tfm+0x43/0xb0
     [&lt;ffffffff94ed83b0&gt;] ? crypto_larval_lookup+0x150/0x150
     [&lt;ffffffff94ed7da2&gt;] ? crypto_alloc_tfm+0x72/0x120
     [&lt;ffffffffc0a01dd7&gt;] ? ceph_aes_encrypt2+0x67/0x400 [libceph]
     [&lt;ffffffffc09fd264&gt;] ? ceph_pg_to_up_acting_osds+0x84/0x5b0 [libceph]
     [&lt;ffffffff950d40a0&gt;] ? release_sock+0x40/0x90
     [&lt;ffffffff95139f94&gt;] ? tcp_recvmsg+0x4b4/0xae0
     [&lt;ffffffffc0a02714&gt;] ? ceph_encrypt2+0x54/0xc0 [libceph]
     [&lt;ffffffffc0a02b4d&gt;] ? ceph_x_encrypt+0x5d/0x90 [libceph]
     [&lt;ffffffffc0a02bdf&gt;] ? calcu_signature+0x5f/0x90 [libceph]
     [&lt;ffffffffc0a02ef5&gt;] ? ceph_x_sign_message+0x35/0x50 [libceph]
     [&lt;ffffffffc09e948c&gt;] ? prepare_write_message_footer+0x5c/0xa0 [libceph]
     [&lt;ffffffffc09ecd18&gt;] ? ceph_con_workfn+0x2258/0x2dd0 [libceph]
     [&lt;ffffffffc09e9903&gt;] ? queue_con_delay+0x33/0xd0 [libceph]
     [&lt;ffffffffc09f68ed&gt;] ? __submit_request+0x20d/0x2f0 [libceph]
     [&lt;ffffffffc09f6ef8&gt;] ? ceph_osdc_start_request+0x28/0x30 [libceph]
     [&lt;ffffffffc0b52603&gt;] ? rbd_queue_workfn+0x2f3/0x350 [rbd]
     [&lt;ffffffff94c94ec0&gt;] ? process_one_work+0x160/0x410
     [&lt;ffffffff94c951bd&gt;] ? worker_thread+0x4d/0x480
     [&lt;ffffffff94c95170&gt;] ? process_one_work+0x410/0x410
     [&lt;ffffffff94c9af8d&gt;] ? kthread+0xcd/0xf0
     [&lt;ffffffff951efb2f&gt;] ? ret_from_fork+0x1f/0x40
     [&lt;ffffffff94c9aec0&gt;] ? kthread_create_on_node+0x190/0x190

Allocating the cipher along with the key fixes the issue - as long the
key doesn't change, a single cipher context can be used concurrently in
multiple requests.

We still can't take that GFP_KERNEL allocation though.  Both
ceph_crypto_key_clone() and ceph_crypto_key_decode() are called from
GFP_NOFS context, so resort to memalloc_noio_{save,restore}() here.

Reported-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7af3ea189a9a13f090de51c97f676215dabc1205 upstream.

This is useless and more importantly not allowed on the writeback path,
because crypto_alloc_skcipher() allocates memory with GFP_KERNEL, which
can recurse back into the filesystem:

    kworker/9:3     D ffff92303f318180     0 20732      2 0x00000080
    Workqueue: ceph-msgr ceph_con_workfn [libceph]
     ffff923035dd4480 ffff923038f8a0c0 0000000000000001 000000009eb27318
     ffff92269eb28000 ffff92269eb27338 ffff923036b145ac ffff923035dd4480
     00000000ffffffff ffff923036b145b0 ffffffff951eb4e1 ffff923036b145a8
    Call Trace:
     [&lt;ffffffff951eb4e1&gt;] ? schedule+0x31/0x80
     [&lt;ffffffff951eb77a&gt;] ? schedule_preempt_disabled+0xa/0x10
     [&lt;ffffffff951ed1f4&gt;] ? __mutex_lock_slowpath+0xb4/0x130
     [&lt;ffffffff951ed28b&gt;] ? mutex_lock+0x1b/0x30
     [&lt;ffffffffc0a974b3&gt;] ? xfs_reclaim_inodes_ag+0x233/0x2d0 [xfs]
     [&lt;ffffffff94d92ba5&gt;] ? move_active_pages_to_lru+0x125/0x270
     [&lt;ffffffff94f2b985&gt;] ? radix_tree_gang_lookup_tag+0xc5/0x1c0
     [&lt;ffffffff94dad0f3&gt;] ? __list_lru_walk_one.isra.3+0x33/0x120
     [&lt;ffffffffc0a98331&gt;] ? xfs_reclaim_inodes_nr+0x31/0x40 [xfs]
     [&lt;ffffffff94e05bfe&gt;] ? super_cache_scan+0x17e/0x190
     [&lt;ffffffff94d919f3&gt;] ? shrink_slab.part.38+0x1e3/0x3d0
     [&lt;ffffffff94d9616a&gt;] ? shrink_node+0x10a/0x320
     [&lt;ffffffff94d96474&gt;] ? do_try_to_free_pages+0xf4/0x350
     [&lt;ffffffff94d967ba&gt;] ? try_to_free_pages+0xea/0x1b0
     [&lt;ffffffff94d863bd&gt;] ? __alloc_pages_nodemask+0x61d/0xe60
     [&lt;ffffffff94ddf42d&gt;] ? cache_grow_begin+0x9d/0x560
     [&lt;ffffffff94ddfb88&gt;] ? fallback_alloc+0x148/0x1c0
     [&lt;ffffffff94ed84e7&gt;] ? __crypto_alloc_tfm+0x37/0x130
     [&lt;ffffffff94de09db&gt;] ? __kmalloc+0x1eb/0x580
     [&lt;ffffffffc09fe2db&gt;] ? crush_choose_firstn+0x3eb/0x470 [libceph]
     [&lt;ffffffff94ed84e7&gt;] ? __crypto_alloc_tfm+0x37/0x130
     [&lt;ffffffff94ed9c19&gt;] ? crypto_spawn_tfm+0x39/0x60
     [&lt;ffffffffc08b30a3&gt;] ? crypto_cbc_init_tfm+0x23/0x40 [cbc]
     [&lt;ffffffff94ed857c&gt;] ? __crypto_alloc_tfm+0xcc/0x130
     [&lt;ffffffff94edcc23&gt;] ? crypto_skcipher_init_tfm+0x113/0x180
     [&lt;ffffffff94ed7cc3&gt;] ? crypto_create_tfm+0x43/0xb0
     [&lt;ffffffff94ed83b0&gt;] ? crypto_larval_lookup+0x150/0x150
     [&lt;ffffffff94ed7da2&gt;] ? crypto_alloc_tfm+0x72/0x120
     [&lt;ffffffffc0a01dd7&gt;] ? ceph_aes_encrypt2+0x67/0x400 [libceph]
     [&lt;ffffffffc09fd264&gt;] ? ceph_pg_to_up_acting_osds+0x84/0x5b0 [libceph]
     [&lt;ffffffff950d40a0&gt;] ? release_sock+0x40/0x90
     [&lt;ffffffff95139f94&gt;] ? tcp_recvmsg+0x4b4/0xae0
     [&lt;ffffffffc0a02714&gt;] ? ceph_encrypt2+0x54/0xc0 [libceph]
     [&lt;ffffffffc0a02b4d&gt;] ? ceph_x_encrypt+0x5d/0x90 [libceph]
     [&lt;ffffffffc0a02bdf&gt;] ? calcu_signature+0x5f/0x90 [libceph]
     [&lt;ffffffffc0a02ef5&gt;] ? ceph_x_sign_message+0x35/0x50 [libceph]
     [&lt;ffffffffc09e948c&gt;] ? prepare_write_message_footer+0x5c/0xa0 [libceph]
     [&lt;ffffffffc09ecd18&gt;] ? ceph_con_workfn+0x2258/0x2dd0 [libceph]
     [&lt;ffffffffc09e9903&gt;] ? queue_con_delay+0x33/0xd0 [libceph]
     [&lt;ffffffffc09f68ed&gt;] ? __submit_request+0x20d/0x2f0 [libceph]
     [&lt;ffffffffc09f6ef8&gt;] ? ceph_osdc_start_request+0x28/0x30 [libceph]
     [&lt;ffffffffc0b52603&gt;] ? rbd_queue_workfn+0x2f3/0x350 [rbd]
     [&lt;ffffffff94c94ec0&gt;] ? process_one_work+0x160/0x410
     [&lt;ffffffff94c951bd&gt;] ? worker_thread+0x4d/0x480
     [&lt;ffffffff94c95170&gt;] ? process_one_work+0x410/0x410
     [&lt;ffffffff94c9af8d&gt;] ? kthread+0xcd/0xf0
     [&lt;ffffffff951efb2f&gt;] ? ret_from_fork+0x1f/0x40
     [&lt;ffffffff94c9aec0&gt;] ? kthread_create_on_node+0x190/0x190

Allocating the cipher along with the key fixes the issue - as long the
key doesn't change, a single cipher context can be used concurrently in
multiple requests.

We still can't take that GFP_KERNEL allocation though.  Both
ceph_crypto_key_clone() and ceph_crypto_key_decode() are called from
GFP_NOFS context, so resort to memalloc_noio_{save,restore}() here.

Reported-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: uninline ceph_crypto_key_destroy()</title>
<updated>2017-01-26T07:24:46+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5b482bf5886855be44e89653f88297aab423dee6'/>
<id>5b482bf5886855be44e89653f88297aab423dee6</id>
<content type='text'>
commit 6db2304aabb070261ad34923bfd83c43dfb000e3 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6db2304aabb070261ad34923bfd83c43dfb000e3 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: make sure ceph_aes_crypt() IV is aligned</title>
<updated>2017-01-26T07:24:43+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2017-01-16T18:16:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a193c72475960dfb98a37d0fc7739a10ccd95111'/>
<id>a193c72475960dfb98a37d0fc7739a10ccd95111</id>
<content type='text'>
commit 124f930b8cbc4ac11236e6eb1c5f008318864588 upstream.

... otherwise the crypto stack will align it for us with a GFP_ATOMIC
allocation and a memcpy() -- see skcipher_walk_first().

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 124f930b8cbc4ac11236e6eb1c5f008318864588 upstream.

... otherwise the crypto stack will align it for us with a GFP_ATOMIC
allocation and a memcpy() -- see skcipher_walk_first().

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: remove now unused ceph_*{en,de}crypt*() functions</title>
<updated>2017-01-26T07:24:42+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b8add6715c9ada1619e6db6d4e106c03df94267c'/>
<id>b8add6715c9ada1619e6db6d4e106c03df94267c</id>
<content type='text'>
commit 2b1e1a7cd0a615d57455567a549f9965023321b5 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2b1e1a7cd0a615d57455567a549f9965023321b5 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: switch ceph_x_decrypt() to ceph_crypt()</title>
<updated>2017-01-26T07:24:42+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2982b9c92a66604ffb9fb2db54cf735133d1ef56'/>
<id>2982b9c92a66604ffb9fb2db54cf735133d1ef56</id>
<content type='text'>
commit e15fd0a11db00fc7f470a9fc804657ec3f6d04a5 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e15fd0a11db00fc7f470a9fc804657ec3f6d04a5 upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: switch ceph_x_encrypt() to ceph_crypt()</title>
<updated>2017-01-26T07:24:41+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=717a145bd5a92e3aae1dae1535b83ec38a85fa1b'/>
<id>717a145bd5a92e3aae1dae1535b83ec38a85fa1b</id>
<content type='text'>
commit d03857c63bb036edff0aa7a107276360173aca4e upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d03857c63bb036edff0aa7a107276360173aca4e upstream.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>libceph: tweak calcu_signature() a little</title>
<updated>2017-01-26T07:24:41+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-12-02T15:35:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6e371f9a4144c1097a675ca482fc90cbcb0fb4e7'/>
<id>6e371f9a4144c1097a675ca482fc90cbcb0fb4e7</id>
<content type='text'>
commit 4eb4517ce7c9c573b6c823de403aeccb40018cfc upstream.

- replace an ad-hoc array with a struct
- rename to calc_signature() for consistency

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4eb4517ce7c9c573b6c823de403aeccb40018cfc upstream.

- replace an ad-hoc array with a struct
- rename to calc_signature() for consistency

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
