From da012cf5736bd6659ca85a4a3ad45ae07dc1f373 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 19 Nov 2012 10:49:08 +0800 Subject: [PATCH] --- yaml --- r: 347607 b: refs/heads/master c: a85f50b6ef93fbbb2ae932ce9b2376509d172796 h: refs/heads/master i: 347605: 69646e832c06594ed289434ace1c37d26775bd7f 347603: edf7461e6dc7a47681d5aef12a64ef9d312faea0 347599: 1297d16be6963caa438f68a318ab3ad3be37a4ac v: v3 --- [refs] | 2 +- trunk/fs/ceph/inode.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 1b334e8f5da1..ec6c8ae4cb3a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0685235ffd9dbdb9ccbda587f8a3c83ad1d5a921 +refs/heads/master: a85f50b6ef93fbbb2ae932ce9b2376509d172796 diff --git a/trunk/fs/ceph/inode.c b/trunk/fs/ceph/inode.c index 4b5762ef7c2b..81613bced19f 100644 --- a/trunk/fs/ceph/inode.c +++ b/trunk/fs/ceph/inode.c @@ -1466,7 +1466,7 @@ void __ceph_do_pending_vmtruncate(struct inode *inode) { struct ceph_inode_info *ci = ceph_inode(inode); u64 to; - int wrbuffer_refs, wake = 0; + int wrbuffer_refs, finish = 0; retry: spin_lock(&ci->i_ceph_lock); @@ -1498,15 +1498,18 @@ void __ceph_do_pending_vmtruncate(struct inode *inode) truncate_inode_pages(inode->i_mapping, to); spin_lock(&ci->i_ceph_lock); - ci->i_truncate_pending--; - if (ci->i_truncate_pending == 0) - wake = 1; + if (to == ci->i_truncate_size) { + ci->i_truncate_pending = 0; + finish = 1; + } spin_unlock(&ci->i_ceph_lock); + if (!finish) + goto retry; if (wrbuffer_refs == 0) ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); - if (wake) - wake_up_all(&ci->i_cap_wq); + + wake_up_all(&ci->i_cap_wq); }