summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-03-09 14:08:24 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-09 15:43:42 -0800
commit566e8dfd88d9e0d12873ca69c26e82c0af8479d8 (patch)
tree7447938a15dc35bfefcef9e361a168594e0c3d6d
parent0d97e6d8024c71cc838b292c01d5bd951e080eba (diff)
downloadop-kernel-dev-566e8dfd88d9e0d12873ca69c26e82c0af8479d8.zip
op-kernel-dev-566e8dfd88d9e0d12873ca69c26e82c0af8479d8.tar.gz
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>
-rw-r--r--fs/ocfs2/mmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
index 9581d190..77ebc2b 100644
--- a/fs/ocfs2/mmap.c
+++ b/fs/ocfs2/mmap.c
@@ -147,6 +147,10 @@ static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = ocfs2_inode_lock(inode, &di_bh, 1);
if (ret < 0) {
mlog_errno(ret);
+ if (ret == -ENOMEM)
+ ret = VM_FAULT_OOM;
+ else
+ ret = VM_FAULT_SIGBUS;
goto out;
}
OpenPOWER on IntegriCloud