summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2015-01-08 14:30:12 +0100
committerIlya Dryomov <idryomov@gmail.com>2015-02-19 11:31:38 +0100
commitd3383a8e37f802818cde4cb489bb0735db637cf0 (patch)
treed4c662fa1a495440c7e6f5e9c851e2562287f930 /fs/ceph/caps.c
parentrbd: fix error paths in rbd_dev_refresh() (diff)
downloadlinux-d3383a8e37f802818cde4cb489bb0735db637cf0.tar.xz
linux-d3383a8e37f802818cde4cb489bb0735db637cf0.zip
ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_sync)
check_cap_flush() calls mutex_lock(), which may block. So we can't use it as condition check function for wait_event(); Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 8ed1192606d9..844b57cb52bd 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1450,8 +1450,8 @@ static int __mark_caps_flushing(struct inode *inode,
spin_lock(&mdsc->cap_dirty_lock);
list_del_init(&ci->i_dirty_item);
- ci->i_cap_flush_seq = ++mdsc->cap_flush_seq;
if (list_empty(&ci->i_flushing_item)) {
+ ci->i_cap_flush_seq = ++mdsc->cap_flush_seq;
list_add_tail(&ci->i_flushing_item, &session->s_cap_flushing);
mdsc->num_cap_flushing++;
dout(" inode %p now flushing seq %lld\n", inode,