<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/ceph/caps.c, branch v4.10</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ceph: fix ceph_get_caps() interruption</title>
<updated>2017-01-18T16:58:45+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-12-22T08:05:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6e09d0fb64402cec579f029ca4c7f39f5c48fc60'/>
<id>6e09d0fb64402cec579f029ca4c7f39f5c48fc60</id>
<content type='text'>
Commit 5c341ee32881 ("ceph: fix scheduler warning due to nested
blocking") causes infinite loop when process is interrupted.  Fix it.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 5c341ee32881 ("ceph: fix scheduler warning due to nested
blocking") causes infinite loop when process is interrupted.  Fix it.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: properly set issue_seq for cap release</title>
<updated>2016-12-12T22:54:28+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-11-17T11:55:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=dc24de82d61b1edc3d195badd178e7875ba9398f'/>
<id>dc24de82d61b1edc3d195badd178e7875ba9398f</id>
<content type='text'>
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: add flags parameter to send_cap_msg</title>
<updated>2016-12-12T22:54:28+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2016-11-10T12:42:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1e4ef0c6332bd90e6c70afc07b35dffaf1eab1a7'/>
<id>1e4ef0c6332bd90e6c70afc07b35dffaf1eab1a7</id>
<content type='text'>
Add a flags parameter to send_cap_msg, so we can request expedited
service from the MDS when we know we'll be waiting on the result.

Set that flag in the case of try_flush_caps. The callers of that
function generally wait synchronously on the result, so it's beneficial
to ask the server to expedite it.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a flags parameter to send_cap_msg, so we can request expedited
service from the MDS when we know we'll be waiting on the result.

Set that flag in the case of try_flush_caps. The callers of that
function generally wait synchronously on the result, so it's beneficial
to ask the server to expedite it.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: update cap message struct version to 10</title>
<updated>2016-12-12T22:54:28+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2016-11-10T12:42:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=43b29673307387f7b939fceeedefd08ece13c41d'/>
<id>43b29673307387f7b939fceeedefd08ece13c41d</id>
<content type='text'>
The userland ceph has MClientCaps at struct version 10. This brings the
kernel up the same version.

For now, all of the the new stuff is set to default values including
the flags field, which will be conditionally set in a later patch.

Note that we don't need to set the change_attr and btime to anything
since we aren't currently setting the feature flag. The MDS should
ignore those values.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The userland ceph has MClientCaps at struct version 10. This brings the
kernel up the same version.

For now, all of the the new stuff is set to default values including
the flags field, which will be conditionally set in a later patch.

Note that we don't need to set the change_attr and btime to anything
since we aren't currently setting the feature flag. The MDS should
ignore those values.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: define new argument structure for send_cap_msg</title>
<updated>2016-12-12T22:54:28+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2016-11-10T12:42:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0ff8bfb394124a7ff4f5a4cd3dc9e8dc52dbe5c9'/>
<id>0ff8bfb394124a7ff4f5a4cd3dc9e8dc52dbe5c9</id>
<content type='text'>
When we get to this many arguments, it's hard to work with positional
parameters. send_cap_msg is already at 25 arguments, with more needed.

Define a new args structure and pass a pointer to it to send_cap_msg.
Eventually it might make sense to embed one of these inside
ceph_cap_snap instead of tracking individual fields.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we get to this many arguments, it's hard to work with positional
parameters. send_cap_msg is already at 25 arguments, with more needed.

Define a new args structure and pass a pointer to it to send_cap_msg.
Eventually it might make sense to embed one of these inside
ceph_cap_snap instead of tracking individual fields.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: move xattr initialzation before the encoding past the ceph_mds_caps</title>
<updated>2016-12-12T22:54:28+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2016-11-10T12:42:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9670079f5f0a52b4ddcc16c407cfe9ff42633e04'/>
<id>9670079f5f0a52b4ddcc16c407cfe9ff42633e04</id>
<content type='text'>
Just for clarity. This part is inside the header, so it makes sense to
group it with the rest of the stuff in the header.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just for clarity. This part is inside the header, so it makes sense to
group it with the rest of the stuff in the header.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: fix minor typo in unsafe_request_wait</title>
<updated>2016-12-12T22:54:27+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2016-11-16T14:45:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4945a084799e24f0954e20f81b9004749cba93e4'/>
<id>4945a084799e24f0954e20f81b9004749cba93e4</id>
<content type='text'>
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reviewed-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: try getting buffer capability for readahead/fadvise</title>
<updated>2016-12-12T22:54:27+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-10-25T02:51:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2b1ac852eb67a6e95595e576371d23519105559f'/>
<id>2b1ac852eb67a6e95595e576371d23519105559f</id>
<content type='text'>
For readahead/fadvise cases, caller of ceph_readpages does not
hold buffer capability. Pages can be added to page cache while
there is no buffer capability. This can cause data integrity
issue.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For readahead/fadvise cases, caller of ceph_readpages does not
hold buffer capability. Pages can be added to page cache while
there is no buffer capability. This can cause data integrity
issue.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: fix scheduler warning due to nested blocking</title>
<updated>2016-12-12T22:54:27+00:00</updated>
<author>
<name>Nikolay Borisov</name>
<email>kernel@kyup.com</email>
</author>
<published>2016-10-11T09:04:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5c341ee32881c554727ec14b71ec3e8832f01989'/>
<id>5c341ee32881c554727ec14b71ec3e8832f01989</id>
<content type='text'>
try_get_cap_refs can be used as a condition in a wait_event* calls.
This is all fine until it has to call __ceph_do_pending_vmtruncate,
which in turn acquires the i_truncate_mutex. This leads to a situation
in which a task's state is !TASK_RUNNING and at the same time it's
trying to acquire a sleeping primitive. In essence a nested sleeping
primitives are being used. This causes the following warning:

WARNING: CPU: 22 PID: 11064 at kernel/sched/core.c:7631 __might_sleep+0x9f/0xb0()
do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;ffffffff8109447d&gt;] prepare_to_wait_event+0x5d/0x110
 ipmi_msghandler tcp_scalable ib_qib dca ib_mad ib_core ib_addr ipv6
CPU: 22 PID: 11064 Comm: fs_checker.pl Tainted: G           O    4.4.20-clouder2 #6
Hardware name: Supermicro X10DRi/X10DRi, BIOS 1.1a 10/16/2015
 0000000000000000 ffff8838b416fa88 ffffffff812f4409 ffff8838b416fad0
 ffffffff81a034f2 ffff8838b416fac0 ffffffff81052b46 ffffffff81a0432c
 0000000000000061 0000000000000000 0000000000000000 ffff88167bda54a0
Call Trace:
 [&lt;ffffffff812f4409&gt;] dump_stack+0x67/0x9e
 [&lt;ffffffff81052b46&gt;] warn_slowpath_common+0x86/0xc0
 [&lt;ffffffff81052bcc&gt;] warn_slowpath_fmt+0x4c/0x50
 [&lt;ffffffff8109447d&gt;] ? prepare_to_wait_event+0x5d/0x110
 [&lt;ffffffff8109447d&gt;] ? prepare_to_wait_event+0x5d/0x110
 [&lt;ffffffff8107767f&gt;] __might_sleep+0x9f/0xb0
 [&lt;ffffffff81612d30&gt;] mutex_lock+0x20/0x40
 [&lt;ffffffffa04eea14&gt;] __ceph_do_pending_vmtruncate+0x44/0x1a0 [ceph]
 [&lt;ffffffffa04fa692&gt;] try_get_cap_refs+0xa2/0x320 [ceph]
 [&lt;ffffffffa04fd6f5&gt;] ceph_get_caps+0x255/0x2b0 [ceph]
 [&lt;ffffffff81094370&gt;] ? wait_woken+0xb0/0xb0
 [&lt;ffffffffa04f2c11&gt;] ceph_write_iter+0x2b1/0xde0 [ceph]
 [&lt;ffffffff81613f22&gt;] ? schedule_timeout+0x202/0x260
 [&lt;ffffffff8117f01a&gt;] ? kmem_cache_free+0x1ea/0x200
 [&lt;ffffffff811b46ce&gt;] ? iput+0x9e/0x230
 [&lt;ffffffff81077632&gt;] ? __might_sleep+0x52/0xb0
 [&lt;ffffffff81156147&gt;] ? __might_fault+0x37/0x40
 [&lt;ffffffff8119e123&gt;] ? cp_new_stat+0x153/0x170
 [&lt;ffffffff81198cfa&gt;] __vfs_write+0xaa/0xe0
 [&lt;ffffffff81199369&gt;] vfs_write+0xa9/0x190
 [&lt;ffffffff811b6d01&gt;] ? set_close_on_exec+0x31/0x70
 [&lt;ffffffff8119a056&gt;] SyS_write+0x46/0xa0

This happens since wait_event_interruptible can interfere with the
mutex locking code, since they both fiddle with the task state.

Fix the issue by using the newly-added nested blocking infrastructure
in 61ada528dea0 ("sched/wait: Provide infrastructure to deal with
nested blocking")

Link: https://lwn.net/Articles/628628/
Signed-off-by: Nikolay Borisov &lt;kernel@kyup.com&gt;
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
try_get_cap_refs can be used as a condition in a wait_event* calls.
This is all fine until it has to call __ceph_do_pending_vmtruncate,
which in turn acquires the i_truncate_mutex. This leads to a situation
in which a task's state is !TASK_RUNNING and at the same time it's
trying to acquire a sleeping primitive. In essence a nested sleeping
primitives are being used. This causes the following warning:

WARNING: CPU: 22 PID: 11064 at kernel/sched/core.c:7631 __might_sleep+0x9f/0xb0()
do not call blocking ops when !TASK_RUNNING; state=1 set at [&lt;ffffffff8109447d&gt;] prepare_to_wait_event+0x5d/0x110
 ipmi_msghandler tcp_scalable ib_qib dca ib_mad ib_core ib_addr ipv6
CPU: 22 PID: 11064 Comm: fs_checker.pl Tainted: G           O    4.4.20-clouder2 #6
Hardware name: Supermicro X10DRi/X10DRi, BIOS 1.1a 10/16/2015
 0000000000000000 ffff8838b416fa88 ffffffff812f4409 ffff8838b416fad0
 ffffffff81a034f2 ffff8838b416fac0 ffffffff81052b46 ffffffff81a0432c
 0000000000000061 0000000000000000 0000000000000000 ffff88167bda54a0
Call Trace:
 [&lt;ffffffff812f4409&gt;] dump_stack+0x67/0x9e
 [&lt;ffffffff81052b46&gt;] warn_slowpath_common+0x86/0xc0
 [&lt;ffffffff81052bcc&gt;] warn_slowpath_fmt+0x4c/0x50
 [&lt;ffffffff8109447d&gt;] ? prepare_to_wait_event+0x5d/0x110
 [&lt;ffffffff8109447d&gt;] ? prepare_to_wait_event+0x5d/0x110
 [&lt;ffffffff8107767f&gt;] __might_sleep+0x9f/0xb0
 [&lt;ffffffff81612d30&gt;] mutex_lock+0x20/0x40
 [&lt;ffffffffa04eea14&gt;] __ceph_do_pending_vmtruncate+0x44/0x1a0 [ceph]
 [&lt;ffffffffa04fa692&gt;] try_get_cap_refs+0xa2/0x320 [ceph]
 [&lt;ffffffffa04fd6f5&gt;] ceph_get_caps+0x255/0x2b0 [ceph]
 [&lt;ffffffff81094370&gt;] ? wait_woken+0xb0/0xb0
 [&lt;ffffffffa04f2c11&gt;] ceph_write_iter+0x2b1/0xde0 [ceph]
 [&lt;ffffffff81613f22&gt;] ? schedule_timeout+0x202/0x260
 [&lt;ffffffff8117f01a&gt;] ? kmem_cache_free+0x1ea/0x200
 [&lt;ffffffff811b46ce&gt;] ? iput+0x9e/0x230
 [&lt;ffffffff81077632&gt;] ? __might_sleep+0x52/0xb0
 [&lt;ffffffff81156147&gt;] ? __might_fault+0x37/0x40
 [&lt;ffffffff8119e123&gt;] ? cp_new_stat+0x153/0x170
 [&lt;ffffffff81198cfa&gt;] __vfs_write+0xaa/0xe0
 [&lt;ffffffff81199369&gt;] vfs_write+0xa9/0x190
 [&lt;ffffffff811b6d01&gt;] ? set_close_on_exec+0x31/0x70
 [&lt;ffffffff8119a056&gt;] SyS_write+0x46/0xa0

This happens since wait_event_interruptible can interfere with the
mutex locking code, since they both fiddle with the task state.

Fix the issue by using the newly-added nested blocking infrastructure
in 61ada528dea0 ("sched/wait: Provide infrastructure to deal with
nested blocking")

Link: https://lwn.net/Articles/628628/
Signed-off-by: Nikolay Borisov &lt;kernel@kyup.com&gt;
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ceph: fix null pointer dereference in ceph_flush_snaps()</title>
<updated>2016-08-08T19:41:43+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-08-04T00:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e4d2b16a445f85b7dc3fc67b21756eca515e0c74'/>
<id>e4d2b16a445f85b7dc3fc67b21756eca515e0c74</id>
<content type='text'>
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
