From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH] aio: remove 'always false' check Date: Wed, 11 Jul 2012 10:17:26 -0400 Message-ID: References: <1341998122-9521-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: bcrl@kvack.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Yuanhan Liu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757914Ab2GKORc (ORCPT ); Wed, 11 Jul 2012 10:17:32 -0400 In-Reply-To: <1341998122-9521-1-git-send-email-yuanhan.liu@linux.intel.com> (Yuanhan Liu's message of "Wed, 11 Jul 2012 17:15:22 +0800") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Yuanhan Liu writes: > The only case that nr_pages will be < 0 is that nr_pages overflowed due > to nr_events is too big. But it is exclued at ioctx_alloc(). Right, the number of events is limited to what will fit in 256MB, for some odd reason. Maybe Ben can comment on that. > Thus, nr_pages will always > 0. So remove the dead 'if (nr_pages < 0)' > code block. Sure, but I don't see any harm in keeping this check. We do add another page to the size, so retesting for overflow is good practice, and isn't going to kill performance. So, I'm going to NAK this. Cheers, Jeff