From: Greg KH Subject: [patch 12/28] GFS2: Fix page_mkwrite() return code Date: Thu, 14 May 2009 15:51:38 -0700 Message-ID: <20090514225238.374798374@mini.kroah.org> References: <20090514225126.907908936@mini.kroah.org> Cc: Justin Forbes , Zwane Mwaikambo , Theodore Ts'o , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, linux-fsdevel@vger.kernel.org, linux-mm@vger.kernel.org, Steven Whitehouse , Nick Piggin To: linux-kernel@vger.kernel.org, stable@kernel.org Return-path: Received: from kroah.org ([198.145.64.141]:46040 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762264AbZENW6h (ORCPT ); Thu, 14 May 2009 18:58:37 -0400 Content-Disposition: inline; filename=gfs2-fix-page_mkwrite-return-code.patch In-Reply-To: <20090514225413.GA705@kroah.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Steven Whitehouse 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 Cc: Nick Piggin Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/ops_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c @@ -412,7 +412,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; }