Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754781Ab0DSNVN (ORCPT ); Mon, 19 Apr 2010 09:21:13 -0400 Received: from ey-out-2122.google.com ([74.125.78.26]:47224 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754707Ab0DSNVM convert rfc822-to-8bit (ORCPT ); Mon, 19 Apr 2010 09:21:12 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:user-agent:mime-version :content-type:content-transfer-encoding; b=lmf/FokNH2K1nyY7/jEE1JHOkHASPoy4rERdsNE0m2iF2INfkOyXCYSfFr6nNltsoR /zzqQxv7nKig+srokyiOBwOPWdGXep28Fy5k84XfMleSfs0AAx8BQCKaqXxH3svAXfhi cyuWRDK+x1Qway8COYI9X2Vrgl04u9mpMb49Y= Date: Mon, 19 Apr 2010 15:21:07 +0200 Message-ID: <87iq7n8toc.wl%vmayatsk@redhat.com> From: Vitaly Mayatskikh To: linux-kernel Cc: Amerigo Wang , Linus Torvalds , Neil Horman Subject: Fix OOPS in crash_kernel_shrink User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.1 Mule/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 34 Two "echo 0 > /sys/kernel/kexec_crash_size" OOPSes kernel. Also content of this file is invalid after first shrink to zero: it shows 1 instead of 0. This patch fixes it. Signed-off-by: Vitaly Mayatskikh diff --git a/kernel/kexec.c b/kernel/kexec.c index 87ebe8a..474a847 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -1134,11 +1134,9 @@ int crash_shrink_memory(unsigned long new_size) free_reserved_phys_range(end, crashk_res.end); - if (start == end) { - crashk_res.end = end; + if (start == end) release_resource(&crashk_res); - } else - crashk_res.end = end - 1; + crashk_res.end = end - 1; unlock: mutex_unlock(&kexec_mutex); -- wbr, Vitaly -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/