GFS2: Fix page_mkwrite() return code
authorSteven Whitehouse <swhiteho@redhat.com>
Mon, 20 Apr 2009 08:45:54 +0000 (09:45 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 20 Apr 2009 15:02:02 +0000 (16:02 +0100)
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>
fs/gfs2/ops_file.c

index 101caf3ee86180b2197568e406dc57922218f474..5d82e91887e31e4eb139d9b34dd461aec66b63f1 100644 (file)
@@ -413,7 +413,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;
 }