From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:37094 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbeK3BQE (ORCPT ); Thu, 29 Nov 2018 20:16:04 -0500 Received: by mail-wr1-f65.google.com with SMTP id j10so2046874wru.4 for ; Thu, 29 Nov 2018 06:10:34 -0800 (PST) Message-ID: <1b49f7958c437878c5fc02cfb82c4ede1064bc08.camel@scylladb.com> Subject: Re: [PATCH 17/20] aio: support for IO polling From: Benny Halevy To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Date: Thu, 29 Nov 2018 16:10:30 +0200 In-Reply-To: References: <20181126164544.5699-1-axboe@kernel.dk> <20181126164544.5699-18-axboe@kernel.dk> <69acea804eaf71f2d05b6ab649ecbf9bfd026447.camel@scylladb.com> <1b282e42a1573bbcba31bd628860b31ce9b60e5c.camel@scylladb.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2018-11-28 at 11:50 -0700, Jens Axboe wrote: > 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. > Agreed.