diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index ba95eea201bf..2971eaa65cdc 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1466,7 +1466,7 @@ void __ceph_do_pending_vmtruncate(struct inode *inode) | |||
1466 | { | 1466 | { |
1467 | struct ceph_inode_info *ci = ceph_inode(inode); | 1467 | struct ceph_inode_info *ci = ceph_inode(inode); |
1468 | u64 to; | 1468 | u64 to; |
1469 | int wrbuffer_refs, wake = 0; | 1469 | int wrbuffer_refs, finish = 0; |
1470 | 1470 | ||
1471 | retry: | 1471 | retry: |
1472 | spin_lock(&ci->i_ceph_lock); | 1472 | spin_lock(&ci->i_ceph_lock); |
@@ -1498,15 +1498,18 @@ retry: | |||
1498 | truncate_inode_pages(inode->i_mapping, to); | 1498 | truncate_inode_pages(inode->i_mapping, to); |
1499 | 1499 | ||
1500 | spin_lock(&ci->i_ceph_lock); | 1500 | spin_lock(&ci->i_ceph_lock); |
1501 | ci->i_truncate_pending--; | 1501 | if (to == ci->i_truncate_size) { |
1502 | if (ci->i_truncate_pending == 0) | 1502 | ci->i_truncate_pending = 0; |
1503 | wake = 1; | 1503 | finish = 1; |
1504 | } | ||
1504 | spin_unlock(&ci->i_ceph_lock); | 1505 | spin_unlock(&ci->i_ceph_lock); |
1506 | if (!finish) | ||
1507 | goto retry; | ||
1505 | 1508 | ||
1506 | if (wrbuffer_refs == 0) | 1509 | if (wrbuffer_refs == 0) |
1507 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); | 1510 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); |
1508 | if (wake) | 1511 | |
1509 | wake_up_all(&ci->i_cap_wq); | 1512 | wake_up_all(&ci->i_cap_wq); |
1510 | } | 1513 | } |
1511 | 1514 | ||
1512 | 1515 | ||