Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764108AbXHPCwc (ORCPT ); Wed, 15 Aug 2007 22:52:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763770AbXHPCwT (ORCPT ); Wed, 15 Aug 2007 22:52:19 -0400 Received: from mail.suse.de ([195.135.220.2]:36876 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763471AbXHPCwS (ORCPT ); Wed, 15 Aug 2007 22:52:18 -0400 Date: Thu, 16 Aug 2007 04:52:17 +0200 From: Nick Piggin To: Dean Nelson Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] calculation of pgoff in do_linear_fault() uses mixed units Message-ID: <20070816025217.GC16372@wotan.suse.de> References: <46C33B3E.mailxBSH11HDLW@aqua.americas.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C33B3E.mailxBSH11HDLW@aqua.americas.sgi.com> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 30 On Wed, Aug 15, 2007 at 12:43:26PM -0500, Dean Nelson wrote: > The calculation of pgoff in do_linear_fault() should use PAGE_SHIFT and not > PAGE_CACHE_SHIFT since vma->vm_pgoff is in units of PAGE_SIZE and not > PAGE_CACHE_SIZE. At the moment linux/pagemap.h has PAGE_CACHE_SHIFT defined > as PAGE_SHIFT, but should that ever change this calculation would break. > > Signed-off-by: Dean Nelson > Acked-by: Nick Piggin > > Index: linux-2.6/mm/memory.c > =================================================================== > --- linux-2.6.orig/mm/memory.c 2007-08-14 06:42:18.322378070 -0500 > +++ linux-2.6/mm/memory.c 2007-08-15 12:30:51.621604739 -0500 > @@ -2465,7 +2465,7 @@ > int write_access, pte_t orig_pte) > { > pgoff_t pgoff = (((address & PAGE_MASK) > - - vma->vm_start) >> PAGE_CACHE_SHIFT) + vma->vm_pgoff; > + - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; > unsigned int flags = (write_access ? FAULT_FLAG_WRITE : 0); > > return __do_fault(mm, vma, address, page_table, pmd, pgoff, - 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/