From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f194.google.com ([209.85.166.194]:34821 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbeK2Fw4 (ORCPT ); Thu, 29 Nov 2018 00:52:56 -0500 Received: by mail-it1-f194.google.com with SMTP id p197so5908777itp.0 for ; Wed, 28 Nov 2018 10:50:19 -0800 (PST) Subject: Re: [PATCH 17/20] aio: support for IO polling To: Benny Halevy Cc: linux-block@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org References: <20181126164544.5699-1-axboe@kernel.dk> <20181126164544.5699-18-axboe@kernel.dk> <69acea804eaf71f2d05b6ab649ecbf9bfd026447.camel@scylladb.com> <1b282e42a1573bbcba31bd628860b31ce9b60e5c.camel@scylladb.com> From: Jens Axboe Message-ID: Date: Wed, 28 Nov 2018 11:50:16 -0700 MIME-Version: 1.0 In-Reply-To: <1b282e42a1573bbcba31bd628860b31ce9b60e5c.camel@scylladb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 11/28/18 2:33 AM, Benny Halevy wrote: >> I don't see how we can get there with it being larger than already, >> that would be a big bug if we fill more events than userspace asked >> for. >> > > Currently we indeed can't, but if the code changes in the future and > we do, this will reduce the damage - hence being safer (and it costs > nothing in terms of performance). The thing is, if we're ever over max, we have potentially corrupted user space memory by copying back too many events. So if anything, it should be a BUG() condition, not just a check. -- Jens Axboe