aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r--fs/ocfs2/aops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 98d36548153d..bbb4b3e5b4ff 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1842,6 +1842,16 @@ out_commit:
1842 ocfs2_commit_trans(osb, handle); 1842 ocfs2_commit_trans(osb, handle);
1843 1843
1844out: 1844out:
1845 /*
1846 * The mmapped page won't be unlocked in ocfs2_free_write_ctxt(),
1847 * even in case of error here like ENOSPC and ENOMEM. So, we need
1848 * to unlock the target page manually to prevent deadlocks when
1849 * retrying again on ENOSPC, or when returning non-VM_FAULT_LOCKED
1850 * to VM code.
1851 */
1852 if (wc->w_target_locked)
1853 unlock_page(mmap_page);
1854
1845 ocfs2_free_write_ctxt(inode, wc); 1855 ocfs2_free_write_ctxt(inode, wc);
1846 1856
1847 if (data_ac) { 1857 if (data_ac) {