linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Ceph fscache: Fix kernel panic due to a race
@ 2013-12-26 14:29 Li Wang
  2013-12-26 14:29 ` [PATCH 1/3] Ceph fscache: Add an interface to synchronize object store limit Li Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Li Wang @ 2013-12-26 14:29 UTC (permalink / raw)
  To: ceph-devel
  Cc: Sage Weil, Milosz Tanski, linux-fsdevel, linux-kernel,
	Yunchuan Wen

From: Yunchuan Wen <yunchuanwen@ubuntukylin.com>

The following scripts could easily panic the kernel,

#!/bin/bash
mount -t ceph -o fsc MONADDR:/ cephfs
rm -rf cephfs/foo
dd if=/dev/zero of=cephfs/foo bs=8 count=512
echo 3 > /proc/sys/vm/drop_caches
dd if=cephfs/foo of=/dev/null bs=8 count=1024

This is due to when writing a page into fscache, the code will
assert that the write position does not exceed the 
object->store_limit_l, which is supposed to be equal to inode->i_size.
However, for current implementation, after file writing, the 
object->store_limit_l is not synchronized with new 
inode->i_size immediately, which introduces a race that if writing
a new page into fscache, will reach the ASSERT that write position
has exceeded the object->store_limit_l, and cause kernel panic. 
This patch fixes it.

Yunchuan Wen (3):
  Ceph fscache: Add an interface to synchronize object store limit
  Ceph fscache: Update object store limit after writing
  Ceph fscache: Wait for completion of object initialization

 fs/ceph/cache.c |    1 +
 fs/ceph/cache.h |   10 ++++++++++
 fs/ceph/file.c  |    3 +++
 3 files changed, 14 insertions(+)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-06 22:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-26 14:29 [PATCH 0/3] Ceph fscache: Fix kernel panic due to a race Li Wang
2013-12-26 14:29 ` [PATCH 1/3] Ceph fscache: Add an interface to synchronize object store limit Li Wang
2013-12-26 14:29 ` [PATCH 2/3] Ceph fscache: Update object store limit after file writing Li Wang
2013-12-26 14:29 ` [PATCH 3/3] Ceph fscache: Wait for completion of object initialization Li Wang
2013-12-26 22:51 ` [PATCH 0/3] Ceph fscache: Fix kernel panic due to a race Milosz Tanski
2013-12-27  1:41   ` Yunchuan Wen
2013-12-28  3:51   ` Li Wang
2014-01-03 14:43     ` Milosz Tanski
2014-03-03 16:54       ` Milosz Tanski
2014-03-06 22:01         ` Sage Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).