Commit 85ce127a authored by Yan, Zheng's avatar Yan, Zheng Committed by Sage Weil

ceph: wake up writer if vmtruncate work get blocked

To write data, the writer first acquires the i_mutex, then try getting
caps. The writer may sleep while holding the i_mutex. If the MDS revokes
Fb cap in this case, vmtruncate work can't do its job because i_mutex
is locked. We should wake up the writer and let it truncate the pages.
Signed-off-by: default avatarYan, Zheng <>
Reviewed-by: default avatarSage Weil <>
parent ad88f23f
......@@ -1465,7 +1465,14 @@ static void ceph_vmtruncate_work(struct work_struct *work)
struct inode *inode = &ci->vfs_inode;
dout("vmtruncate_work %p\n", inode);
if (!mutex_trylock(&inode->i_mutex)) {
* the i_mutex can be hold by a writer who is waiting for
* caps. wake up waiters, they will do pending vmtruncate.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment