Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967456Ab3DRJfP (ORCPT ); Thu, 18 Apr 2013 05:35:15 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:43933 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967442Ab3DRJfL (ORCPT ); Thu, 18 Apr 2013 05:35:11 -0400 From: HATAYAMA Daisuke Subject: [PATCH v4 6/8] vmcore: count holes generated by round-up operation for page boudary for size of /proc/vmcore To: vgoyal@redhat.com, ebiederm@xmission.com, akpm@linux-foundation.org Cc: cpw@sgi.com, kumagai-atsushi@mxc.nes.nec.co.jp, lisa.mitchell@hp.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, zhangyanfei@cn.fujitsu.com, jingbai.ma@hp.com Date: Sat, 13 Apr 2013 09:21:40 +0900 Message-ID: <20130413002140.18245.12374.stgit@localhost6.localdomain6> In-Reply-To: <20130413002000.18245.21513.stgit@localhost6.localdomain6> References: <20130413002000.18245.21513.stgit@localhost6.localdomain6> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 34 Signed-off-by: HATAYAMA Daisuke --- fs/proc/vmcore.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index e27da40..029bdc0 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -266,7 +266,7 @@ static u64 __init get_vmcore_size_elf64(char *elfptr, size_t elfsz) phdr_ptr = (Elf64_Phdr*)(elfptr + sizeof(Elf64_Ehdr)); size = elfsz; for (i = 0; i < ehdr_ptr->e_phnum; i++) { - size += phdr_ptr->p_memsz; + size += roundup(phdr_ptr->p_memsz, PAGE_SIZE); phdr_ptr++; } return size; @@ -283,7 +283,7 @@ static u64 __init get_vmcore_size_elf32(char *elfptr, size_t elfsz) phdr_ptr = (Elf32_Phdr*)(elfptr + sizeof(Elf32_Ehdr)); size = elfsz; for (i = 0; i < ehdr_ptr->e_phnum; i++) { - size += phdr_ptr->p_memsz; + size += roundup(phdr_ptr->p_memsz, PAGE_SIZE); phdr_ptr++; } return size; -- 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/