<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-obmc-linux/fs/ceph, branch v4.6</title>
<subtitle>Talos™ II Linux sources for OpenBMC</subtitle>
<id>https://git.raptorcs.com/git/talos-obmc-linux/atom?h=v4.6</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-obmc-linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/'/>
<updated>2016-04-25T18:54:13+00:00</updated>
<entry>
<title>libceph: make authorizer destruction independent of ceph_auth_client</title>
<updated>2016-04-25T18:54:13+00:00</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-04-11T17:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=6c1ea260f89709e0021d2c59f8fd2a104b5b1123'/>
<id>urn:sha1:6c1ea260f89709e0021d2c59f8fd2a104b5b1123</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros</title>
<updated>2016-04-04T17:41:08+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2016-04-01T12:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a'/>
<id>urn:sha1:09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a</id>
<content type='text'>
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.

This promise never materialized.  And unlikely will.

We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE.  And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.

Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.

Let's stop pretending that pages in page cache are special.  They are
not.

The changes are pretty straight-forward:

 - &lt;foo&gt; &lt;&lt; (PAGE_CACHE_SHIFT - PAGE_SHIFT) -&gt; &lt;foo&gt;;

 - &lt;foo&gt; &gt;&gt; (PAGE_CACHE_SHIFT - PAGE_SHIFT) -&gt; &lt;foo&gt;;

 - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -&gt; PAGE_{SIZE,SHIFT,MASK,ALIGN};

 - page_cache_get() -&gt; get_page();

 - page_cache_release() -&gt; put_page();

This patch contains automated changes generated with coccinelle using
script below.  For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.

The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.

There are few places in the code where coccinelle didn't reach.  I'll
fix them manually in a separate patch.  Comments and documentation also
will be addressed with the separate patch.

virtual patch

@@
expression E;
@@
- E &lt;&lt; (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
expression E;
@@
- E &gt;&gt; (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E

@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT

@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE

@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK

@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)

@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)

@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ceph: use kmem_cache_zalloc</title>
<updated>2016-03-25T17:51:56+00:00</updated>
<author>
<name>Geliang Tang</name>
<email>geliangtang@163.com</email>
</author>
<published>2016-03-13T07:26:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=99ec269779f1fde25356e14299419551cdb54443'/>
<id>urn:sha1:99ec269779f1fde25356e14299419551cdb54443</id>
<content type='text'>
Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.

Signed-off-by: Geliang Tang &lt;geliangtang@163.com&gt;
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</content>
</entry>
<entry>
<title>ceph: use lookup request to revalidate dentry</title>
<updated>2016-03-25T17:51:56+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-17T06:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=200fd27c8fa2ba8bb4529033967b69a7cbfa2c2e'/>
<id>urn:sha1:200fd27c8fa2ba8bb4529033967b69a7cbfa2c2e</id>
<content type='text'>
If dentry has no lease, ceph_d_revalidate() previously return 0.
This causes VFS to invalidate the dentry and create a new dentry
for later lookup. Invalidating a dentry also detach any underneath
mount points. So mount point inside cephfs can disapear mystically
(even the mount point is not modified by other hosts).

The fix is using lookup request to revalidate dentry without lease.
This can partly solve the mount points disapear issue (as long as
the mount point is not modified by other hosts)

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: kill ceph_get_dentry_parent_inode()</title>
<updated>2016-03-25T17:51:55+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-16T08:40:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=641235d8f823574961d225bdbfaef299842aa38c'/>
<id>urn:sha1:641235d8f823574961d225bdbfaef299842aa38c</id>
<content type='text'>
use vfs helper dget_parent() instead

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: fix security xattr deadlock</title>
<updated>2016-03-25T17:51:55+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-07T02:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=315f24088048a51eed341c53be66ea477a3c7d16'/>
<id>urn:sha1:315f24088048a51eed341c53be66ea477a3c7d16</id>
<content type='text'>
When security is enabled, security module can call filesystem's
getxattr/setxattr callbacks during d_instantiate(). For cephfs,
d_instantiate() is usually called by MDS' dispatch thread, while
handling MDS reply. If the MDS reply does not include xattrs and
corresponding caps, getxattr/setxattr need to send a new request
to MDS and waits for the reply. This makes MDS' dispatch sleep,
nobody handles later MDS replies.

The fix is make sure lookup/atomic_open reply include xattrs and
corresponding caps. So getxattr can be handled by cached xattrs.
This requires some modification to both MDS and request message.
(Client tells MDS what caps it wants; MDS encodes proper caps in
the reply)

Smack security module may call setxattr during d_instantiate().
Unlike getxattr, we can't force MDS to issue CEPH_CAP_XATTR_EXCL
to us. So just make setxattr return error when called by MDS'
dispatch thread.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: don't request vxattrs from MDS</title>
<updated>2016-03-25T17:51:55+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-12T05:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=29dccfa5af388916e48a3edc5ac9dc8cc996d9b4'/>
<id>urn:sha1:29dccfa5af388916e48a3edc5ac9dc8cc996d9b4</id>
<content type='text'>
It's uselese because MDS reply does not carry any vxattr.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: fix mounting same fs multiple times</title>
<updated>2016-03-25T17:51:54+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-12T05:20:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=132ca7e1de1e3217af06bce2beb3aa13c3edc7f6'/>
<id>urn:sha1:132ca7e1de1e3217af06bce2beb3aa13c3edc7f6</id>
<content type='text'>
Now __ceph_open_session() only accepts closed client. An opened
client will tigger BUG_ON().

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: remove unnecessary NULL check</title>
<updated>2016-03-25T17:51:54+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-03-10T03:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=4531126753aaf936e2674d28245400c6559ef0ee'/>
<id>urn:sha1:4531126753aaf936e2674d28245400c6559ef0ee</id>
<content type='text'>
If page-&gt;mapping is NULL, releasepage() callback does not get called.
Remove the unnecessary NULL check to make static code analysis tool
happy

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
<entry>
<title>ceph: avoid updating directory inode's i_size accidentally</title>
<updated>2016-03-25T17:51:53+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zyan@redhat.com</email>
</author>
<published>2016-02-26T09:16:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=a3d714c33632ef6bfdfaacc74ae6ba297b4c5820'/>
<id>urn:sha1:a3d714c33632ef6bfdfaacc74ae6ba297b4c5820</id>
<content type='text'>
Directory inode's i_size is used by readdir cache.

Signed-off-by: Yan, Zheng &lt;zyan@redhat.com&gt;
</content>
</entry>
</feed>
