From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 4/8 ver5] exofs: address_space_operations Date: Tue, 31 Mar 2009 03:15:23 -0700 Message-ID: <20090331031523.fcf01cae.akpm@linux-foundation.org> References: <49C1331D.1080805@panasas.com> <1237399473-29344-1-git-send-email-bharrosh@panasas.com> <49C64416.4060801@panasas.com> <20090331010420.8a12810e.akpm@linux-foundation.org> <49D1DCA4.6010306@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Avishay Traeger , Jeff Garzik , Evgeniy Polyakov , linux-fsdevel , open-osd , Marcin Slusarz , linux-kernel , James Bottomley , FUJITA Tomonori To: Boaz Harrosh Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:37542 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbZCaKXE (ORCPT ); Tue, 31 Mar 2009 06:23:04 -0400 In-Reply-To: <49D1DCA4.6010306@panasas.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 31 Mar 2009 12:04:36 +0300 Boaz Harrosh wrote: > >> +static int write_exec(struct page_collect *pcol) > >> +{ > >> + struct exofs_i_info *oi = exofs_i(pcol->inode); > >> + struct osd_obj_id obj = {pcol->sbi->s_pid, > >> + pcol->inode->i_ino + EXOFS_OBJ_OFF}; > >> + struct osd_request *or = NULL; > >> + struct page_collect *pcol_copy = NULL; > >> + loff_t i_start = pcol->pg_first << PAGE_CACHE_SHIFT; > > > > bug. On 32-bit this shift will overflow prior to getting promoted to > > 64-bit. Do: > > > > loff_t i_start = (loff_t)pcol->pg_first << PAGE_CACHE_SHIFT; > > > > In that case I might make pcol->pg_first loff_t. That would work. > Why is inode->i_index not an loff_t then? hm, what's i_index? > Page-index <=> byte-offset, is done all the time 12 bits does not > make a difference. Page indices are 32-bit on 32-bit CPUs. File offsets are 64-bit. We are careful to avoid the above overflow bug whenever the conversion from page index to file size is made. Try fgrep '(loff_t)' mm/*.c