diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4906ada4a97c..55aaddb4047e 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1465,7 +1465,14 @@ static void ceph_vmtruncate_work(struct work_struct *work) | |||
1465 | struct inode *inode = &ci->vfs_inode; | 1465 | struct inode *inode = &ci->vfs_inode; |
1466 | 1466 | ||
1467 | dout("vmtruncate_work %p\n", inode); | 1467 | dout("vmtruncate_work %p\n", inode); |
1468 | mutex_lock(&inode->i_mutex); | 1468 | if (!mutex_trylock(&inode->i_mutex)) { |
1469 | /* | ||
1470 | * the i_mutex can be hold by a writer who is waiting for | ||
1471 | * caps. wake up waiters, they will do pending vmtruncate. | ||
1472 | */ | ||
1473 | wake_up_all(&ci->i_cap_wq); | ||
1474 | mutex_lock(&inode->i_mutex); | ||
1475 | } | ||
1469 | __ceph_do_pending_vmtruncate(inode); | 1476 | __ceph_do_pending_vmtruncate(inode); |
1470 | mutex_unlock(&inode->i_mutex); | 1477 | mutex_unlock(&inode->i_mutex); |
1471 | iput(inode); | 1478 | iput(inode); |