<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ceph/super.h, branch linux-3.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-11-23T19:00:59Z</updated>
<entry>
<title>ceph: queue cap release in __ceph_remove_cap()</title>
<updated>2013-11-23T19:00:59Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-09-22T02:15:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a096b09aeec6ff99edfdfd8cee24d6f25377d585'/>
<id>urn:sha1:a096b09aeec6ff99edfdfd8cee24d6f25377d585</id>
<content type='text'>
call __queue_cap_release() in __ceph_remove_cap(), this avoids
acquiring s_cap_lock twice.

Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: remove ceph_lookup_inode()</title>
<updated>2013-09-06T19:55:09Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-09-02T07:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed284c49f61165c3ba1b4e6969d1cc30a769c31b'/>
<id>urn:sha1:ed284c49f61165c3ba1b4e6969d1cc30a769c31b</id>
<content type='text'>
commit 6f60f889 (ceph: fix freeing inode vs removing session caps race)
introduced ceph_lookup_inode(). But there is already a ceph_find_inode()
which provides similar function. So remove ceph_lookup_inode(), use
ceph_find_inode() instead.

Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
Reviewed-by: Alex Elder &lt;alex.elder@linary.org&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: use fscache as a local presisent cache</title>
<updated>2013-09-06T16:50:11Z</updated>
<author>
<name>Milosz Tanski</name>
</author>
<published>2013-08-21T21:29:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99ccbd229cf7453206bc858e795ec1f0345ff258'/>
<id>urn:sha1:99ccbd229cf7453206bc858e795ec1f0345ff258</id>
<content type='text'>
Adding support for fscache to the Ceph filesystem. This would bring it to on
par with some of the other network filesystems in Linux (like NFS, AFS, etc...)

In order to mount the filesystem with fscache the 'fsc' mount option must be
passed.

Signed-off-by: Milosz Tanski &lt;milosz@adfin.com&gt;
Signed-off-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: introduce i_truncate_mutex</title>
<updated>2013-08-15T18:12:06Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-08-13T04:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0d7c2231015b331b942746610a05b6ea72977ab'/>
<id>urn:sha1:b0d7c2231015b331b942746610a05b6ea72977ab</id>
<content type='text'>
I encountered below deadlock when running fsstress

wmtruncate work      truncate                 MDS
---------------  ------------------  --------------------------
                   lock i_mutex
                                      &lt;- truncate file
lock i_mutex (blocked)
                                      &lt;- revoking Fcb (filelock to MIX)
                   send request -&gt;
                                         handle request (xlock filelock)

At the initial time, there are some dirty pages in the page cache.
When the kclient receives the truncate message, it reduces inode size
and creates some 'out of i_size' dirty pages. wmtruncate work can't
truncate these dirty pages because it's blocked by the i_mutex. Later
when the kclient receives the cap message that revokes Fcb caps, It
can't flush all dirty pages because writepages() only flushes dirty
pages within the inode size.

When the MDS handles the 'truncate' request from kclient, it waits
for the filelock to become stable. But the filelock is stuck in
unstable state because it can't finish revoking kclient's Fcb caps.

The truncate pagecache locking has already caused lots of trouble
for use. I think it's time simplify it by introducing a new mutex.
We use the new mutex to prevent concurrent truncate_inode_pages().
There is no need to worry about race between buffered write and
truncate_inode_pages(), because our "get caps" mechanism prevents
them from concurrent execution.

Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
</content>
</entry>
<entry>
<title>ceph: fix freeing inode vs removing session caps race</title>
<updated>2013-08-10T00:55:32Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-07-24T04:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f60f889470aecf747610279545c054a99aadca3'/>
<id>urn:sha1:6f60f889470aecf747610279545c054a99aadca3</id>
<content type='text'>
remove_session_caps() uses iterate_session_caps() to remove caps,
but iterate_session_caps() skips inodes that are being deleted.
So session-&gt;s_nr_caps can be non-zero after iterate_session_caps()
return.

We can fix the issue by waiting until deletions are complete.
__wait_on_freeing_inode() is designed for the job, but it is not
exported, so we use lookup inode function to access it.

Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
</content>
</entry>
<entry>
<title>ceph: fix pending vmtruncate race</title>
<updated>2013-07-03T22:32:56Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-07-02T04:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b415bf4f9fe25f39934f5c464125e4a2dffb6d08'/>
<id>urn:sha1:b415bf4f9fe25f39934f5c464125e4a2dffb6d08</id>
<content type='text'>
The locking order for pending vmtruncate is wrong, it can lead to
following race:

        write                  wmtruncate work
------------------------    ----------------------
lock i_mutex
check i_truncate_pending   check i_truncate_pending
truncate_inode_pages()     lock i_mutex (blocked)
copy data to page cache
unlock i_mutex
                           truncate_inode_pages()

The fix is take i_mutex before calling __ceph_do_pending_vmtruncate()

Fixes: http://tracker.ceph.com/issues/5453
Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: Reconstruct the func ceph_reserve_caps.</title>
<updated>2013-07-03T22:32:54Z</updated>
<author>
<name>majianpeng</name>
</author>
<published>2013-06-26T03:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93faca6ef45822b0825bb181859b1a8911e9c4c1'/>
<id>urn:sha1:93faca6ef45822b0825bb181859b1a8911e9c4c1</id>
<content type='text'>
Drop ignored return value.  Fix allocation failure case to not leak.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Reviewed-by: Sage Weil &lt;sage@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: ceph_pagelist_append might sleep while atomic</title>
<updated>2013-05-17T17:45:48Z</updated>
<author>
<name>Jim Schutt</name>
</author>
<published>2013-05-15T18:03:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39be95e9c8c0b5668c9f8806ffe29bf9f4bc0f40'/>
<id>urn:sha1:39be95e9c8c0b5668c9f8806ffe29bf9f4bc0f40</id>
<content type='text'>
Ceph's encode_caps_cb() worked hard to not call __page_cache_alloc()
while holding a lock, but it's spoiled because ceph_pagelist_addpage()
always calls kmap(), which might sleep.  Here's the result:

[13439.295457] ceph: mds0 reconnect start
[13439.300572] BUG: sleeping function called from invalid context at include/linux/highmem.h:58
[13439.309243] in_atomic(): 1, irqs_disabled(): 0, pid: 12059, name: kworker/1:1
    . . .
[13439.376225] Call Trace:
[13439.378757]  [&lt;ffffffff81076f4c&gt;] __might_sleep+0xfc/0x110
[13439.384353]  [&lt;ffffffffa03f4ce0&gt;] ceph_pagelist_append+0x120/0x1b0 [libceph]
[13439.391491]  [&lt;ffffffffa0448fe9&gt;] ceph_encode_locks+0x89/0x190 [ceph]
[13439.398035]  [&lt;ffffffff814ee849&gt;] ? _raw_spin_lock+0x49/0x50
[13439.403775]  [&lt;ffffffff811cadf5&gt;] ? lock_flocks+0x15/0x20
[13439.409277]  [&lt;ffffffffa045e2af&gt;] encode_caps_cb+0x41f/0x4a0 [ceph]
[13439.415622]  [&lt;ffffffff81196748&gt;] ? igrab+0x28/0x70
[13439.420610]  [&lt;ffffffffa045e9f8&gt;] ? iterate_session_caps+0xe8/0x250 [ceph]
[13439.427584]  [&lt;ffffffffa045ea25&gt;] iterate_session_caps+0x115/0x250 [ceph]
[13439.434499]  [&lt;ffffffffa045de90&gt;] ? set_request_path_attr+0x2d0/0x2d0 [ceph]
[13439.441646]  [&lt;ffffffffa0462888&gt;] send_mds_reconnect+0x238/0x450 [ceph]
[13439.448363]  [&lt;ffffffffa0464542&gt;] ? ceph_mdsmap_decode+0x5e2/0x770 [ceph]
[13439.455250]  [&lt;ffffffffa0462e42&gt;] check_new_map+0x352/0x500 [ceph]
[13439.461534]  [&lt;ffffffffa04631ad&gt;] ceph_mdsc_handle_map+0x1bd/0x260 [ceph]
[13439.468432]  [&lt;ffffffff814ebc7e&gt;] ? mutex_unlock+0xe/0x10
[13439.473934]  [&lt;ffffffffa043c612&gt;] extra_mon_dispatch+0x22/0x30 [ceph]
[13439.480464]  [&lt;ffffffffa03f6c2c&gt;] dispatch+0xbc/0x110 [libceph]
[13439.486492]  [&lt;ffffffffa03eec3d&gt;] process_message+0x1ad/0x1d0 [libceph]
[13439.493190]  [&lt;ffffffffa03f1498&gt;] ? read_partial_message+0x3e8/0x520 [libceph]
    . . .
[13439.587132] ceph: mds0 reconnect success
[13490.720032] ceph: mds0 caps stale
[13501.235257] ceph: mds0 recovery completed
[13501.300419] ceph: mds0 caps renewed

Fix it up by encoding locks into a buffer first, and when the number
of encoded locks is stable, copy that into a ceph_pagelist.

[elder@inktank.com: abbreviated the stack info a bit.]

Cc: stable@vger.kernel.org # 3.4+
Signed-off-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Reviewed-by: Alex Elder &lt;elder@inktank.com&gt;
</content>
</entry>
<entry>
<title>ceph: use i_release_count to indicate dir's completeness</title>
<updated>2013-05-02T04:17:07Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-03-13T11:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f276c511137d97e56b19e29865e1e6569315ccb'/>
<id>urn:sha1:2f276c511137d97e56b19e29865e1e6569315ccb</id>
<content type='text'>
Current ceph code tracks directory's completeness in two places.
ceph_readdir() checks i_release_count to decide if it can set the
I_COMPLETE flag in i_ceph_flags. All other places check the I_COMPLETE
flag. This indirection introduces locking complexity.

This patch adds a new variable i_complete_count to ceph_inode_info.
Set i_release_count's value to it when marking a directory complete.
By comparing the two variables, we know if a directory is complete

Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
</content>
</entry>
<entry>
<title>ceph: acquire i_mutex in __ceph_do_pending_vmtruncate</title>
<updated>2013-05-02T04:16:11Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2013-03-01T02:57:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f99969f42300e52779ae0656678c2534097f2ea'/>
<id>urn:sha1:3f99969f42300e52779ae0656678c2534097f2ea</id>
<content type='text'>
make __ceph_do_pending_vmtruncate() acquire the i_mutex if the caller
does not hold the i_mutex, so ceph_aio_read() can call safely.

Signed-off-by: Yan, Zheng &lt;zheng.z.yan@intel.com&gt;
Reviewed-by: Greg Farnum &lt;greg@inktank.com&gt;
</content>
</entry>
</feed>
