From: Masayoshi MIZUMA Subject: Re: [PATCH][RFC] vfs: block_read_full_page allocates array depending on environment Date: Tue, 02 Feb 2010 13:36:43 +0900 Message-ID: <20100202133642.FA62.61FB500B@jp.fujitsu.com> References: <20100201172105.14DE.61FB500B@jp.fujitsu.com> <874om1z5oz.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: Alexander Viro , linux-fsdevel@vger.kernel.org To: OGAWA Hirofumi Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:33904 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532Ab0BBEfw (ORCPT ); Mon, 1 Feb 2010 23:35:52 -0500 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o124Znls003229 for (envelope-from m.mizuma@jp.fujitsu.com); Tue, 2 Feb 2010 13:35:49 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 53D2045DD77 for ; Tue, 2 Feb 2010 13:35:49 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 2BAC145DE55 for ; Tue, 2 Feb 2010 13:35:49 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 05BF7E78001 for ; Tue, 2 Feb 2010 13:35:49 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.249.87.104]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id A41831DB8041 for ; Tue, 2 Feb 2010 13:35:48 +0900 (JST) In-Reply-To: <874om1z5oz.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: OGAWA Hirofumi wrote: > Masayoshi MIZUMA writes: > > > OGAWA Hirofumi wrote: > > > >> Masayoshi MIZUMA writes: > >> > >> > @@ -2146,13 +2146,12 @@ int block_read_full_page(struct page *page, get_block_t *get_block) > >> > { > >> > struct inode *inode = page->mapping->host; > >> > sector_t iblock, lblock; > >> > - struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE]; > >> > - unsigned int blocksize; > >> > + unsigned int blocksize = 1 << inode->i_blkbits; > >> > + struct buffer_head *bh, *head, *arr[PAGE_CACHE_SIZE / blocksize]; > >> > >> In practice, we avoid to use the variable-length array on the kernel > >> stack. Although I'm not sure how important it is, there are some reasons > >> to avoid. Also sparse will warn it, IIRC. > > > > Umm... I understand the practice itself, but is there specific reason for > > the practice ? If there isn't, we don't need to avoid use it, I think. > > For example, from quick google > > http://lkml.org/lkml/2003/9/2/202 > > I guess you can find more reasons if needed. I understand it. Thanks a lot ! Thanks, Masayoshi