GFS2: Fix page_mkwrite() return code
authorSteven Whitehouse <swhiteho@redhat.com>
Mon, 20 Apr 2009 08:45:54 +0000 (09:45 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 May 2009 23:35:05 +0000 (16:35 -0700)
commit e56985da455b9dc0591b8cb2006cc94b6f4fb0f4 upstream.

This allows for the possibility of returning VM_FAULT_OOM as
well as VM_FAULT_SIGBUS. This ensures that the correct action
is taken.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/gfs2/ops_file.c

index ed785c1cb13675ddf3cb4e8ac61176b29ab7e836..0093a33426427176f9046195b29a11035601dd42 100644 (file)
@@ -410,7 +410,9 @@ out_unlock:
        gfs2_glock_dq(&gh);
 out:
        gfs2_holder_uninit(&gh);
-       if (ret)
+       if (ret == -ENOMEM)
+               ret = VM_FAULT_OOM;
+       else if (ret)
                ret = VM_FAULT_SIGBUS;
        return ret;
 }