From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943AbcFTOUR (ORCPT ); Mon, 20 Jun 2016 10:20:17 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:46952 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751815AbcFTOUN (ORCPT ); Mon, 20 Jun 2016 10:20:13 -0400 Date: Mon, 20 Jun 2016 15:17:39 +0100 From: Al Viro To: Minfei Huang Cc: bcrl@kvack.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-kernel@vger.kernel.org, minfei.hmf@alibaba-inc.com Subject: Re: [PATCH] aio: Cleanup unnecessary test for nr_pages Message-ID: <20160620141739.GK14480@ZenIV.linux.org.uk> References: <1465749234-25746-1-git-send-email-mnghuan@gmail.com> <20160620140545.GA87874@MinfeideMacBook-Pro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160620140545.GA87874@MinfeideMacBook-Pro.local> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20, 2016 at 10:05:45PM +0800, Minfei Huang wrote: > Ping. Any comment is appreciate. > > Thanks > Minfei > > On 06/13/16 at 12:33P, Minfei Huang wrote: > > The variable nr_pages is always more than 1, because the size of > > structure aio_ring is bigger than 0. So remove unnecessary test for > > nr_page. What this test really checks is that the value we'd put into nr_pages (PFN_UP(size)) is not greater than 2^31. Whether it's redundant or not is a separate question - it very well might be, due to the code in ioctx_alloc() that caps nr_events, but that needs a proof. In any case, the reasons you are offering in commit message are wrong - it's about size being too _large_, not too small.