Skip to content

Commit 566e8df

Browse files
jankaratorvalds
authored andcommitted
ocfs2: fix return value from ocfs2_page_mkwrite()
ocfs2_page_mkwrite() could mistakenly return error code instead of mkwrite status value. Fix it. Signed-off-by: Jan Kara <jack@suse.cz> Cc: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <joseph.qi@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0d97e6d commit 566e8df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/ocfs2/mmap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
147147
ret = ocfs2_inode_lock(inode, &di_bh, 1);
148148
if (ret < 0) {
149149
mlog_errno(ret);
150+
if (ret == -ENOMEM)
151+
ret = VM_FAULT_OOM;
152+
else
153+
ret = VM_FAULT_SIGBUS;
150154
goto out;
151155
}
152156

0 commit comments

Comments
 (0)