Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2391596pxu; Fri, 9 Oct 2020 16:15:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm7Juvi+kYnNQkiCQuBNrZxV3yzh1bocSjjv/VBM1NL7heMwWrBDaf/ZCSz8YLJWkXxihc X-Received: by 2002:a17:906:4ec7:: with SMTP id i7mr16442317ejv.439.1602285301987; Fri, 09 Oct 2020 16:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602285301; cv=none; d=google.com; s=arc-20160816; b=zLxMG0rz+l9iKEg4yfbT3tG9w8y6p+HKrc5xlAvIOTnBdkVc7kyAq32HJG4ljfRgp6 hgRw62549tdtg2ErcSn3Se/0U6C3Y1bSQ+z0/6/AvCn+8vg33qUO/AxB8c2vD/jw+oul o8KexeMgLW011XMwbfuBvOZ3FQLJk3T5FKilNlztzmch0KVdoD5hmcEi5SZBJKsj0C2Z 3RttU1vCfbM7MhYoGf/cDfFnjm3gPCLBbvmMByKbTNm74CpmMRdjnTRIm82+FIO0dJDI 4qANCeXbs16Hg6yW3dt+dr1W4yDodlWnCAkmL/ODlmAqrD/bt/KZzt9ua6TyNRjmfBRE E4sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fpwKpB0QRMQy9tLZQv1g7PmBUfEuKMv/BEO55MnQHTc=; b=V5D6kvRppRT8sSbO54qGT2q/8cwhwj6SXNvb4hRoawx8N7/i3a4h3ESngX+xajA2eW 2Wvu5cvtEy0Gy7Po2Hdmmr5OjysqrcHwzGLZYwDXRyAN7qG6slbaLKuGBsot6lzG5Ng4 ckSj5ICRCv+lF3MFd5OBPvVG1bmDnR5NWKFzJXx0bQo4MpKF5FElO/BZFo3PColZ8+VF JADRiFx8wsRJiCQ0EtlzfTzmGlxgr1XXx8On+QCzX+PG06mvkR7IF87T6jwOWPyYI2xT uekES5pP3mLoJJd/3So7G+ksDOVkjkakOaBLH5Vq9w1ojg52n+WO7ZngmgCKBH7JkQpr o7aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=epj475Fd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si6010524ejb.236.2020.10.09.16.14.39; Fri, 09 Oct 2020 16:15:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=epj475Fd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733053AbgJIRgf (ORCPT + 99 others); Fri, 9 Oct 2020 13:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732882AbgJIRgW (ORCPT ); Fri, 9 Oct 2020 13:36:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 942DFC0613D2; Fri, 9 Oct 2020 10:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fpwKpB0QRMQy9tLZQv1g7PmBUfEuKMv/BEO55MnQHTc=; b=epj475FdxE/6piVligw7f/O1Gg C51sXJjusavAgwM0+vopbw1kAT6F8MeRMLuZqu9GF5kosFlBr0DMLgR2b+U5Cih/1Kg6WOrmU7ufb ceowujvqt7mbx32fx0QHFLbrRyRmMZ7GHavqZM/eb1rc9k+kpVfntqs8R9aKVI/A+Mt1LLcmAHwJ3 pBzpV08VvjTAfGqihoUByDmRGPVtJNbnKEbbeYz9rCPLqWJ5x4g0YEHuNmtfXvgQ2Uy/yPxJF4E/c 7MtAAMQ8f8VyU2MrKUfpkE7D6wq4rWwqK3OU7ICBl31srqQhYEPyab/V682eiyCfvlN2kjP2Rcugr SeLThKMA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQwJY-0001Eh-D3; Fri, 09 Oct 2020 17:36:20 +0000 Date: Fri, 9 Oct 2020 18:36:20 +0100 From: Matthew Wilcox To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Begunkov Subject: Re: [PATCH 2/3] io_uring: Fix XArray usage in io_uring_add_task_file Message-ID: <20201009173620.GV20115@casper.infradead.org> References: <20201009124954.31830-1-willy@infradead.org> <20201009124954.31830-2-willy@infradead.org> <0746e0aa-cb81-0fde-5405-acb1e61b6854@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0746e0aa-cb81-0fde-5405-acb1e61b6854@kernel.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09, 2020 at 08:57:55AM -0600, Jens Axboe wrote: > > + if (unlikely(!cur_uring)) { > > int ret; > > > > ret = io_uring_alloc_task_context(current); > > if (unlikely(ret)) > > return ret; > > } > > I think this is missing a: > > cur_uring = current->io_uring; > > after the successful io_uring_alloc_task(). I'll also rename it to tctx > like what is used in other spots. Quite right! I should have woken up a little bit more before writing code. > Apart from that, series looks good to me, thanks Matthew! NP. At some point, I'd like to understand a bit better how you came to write the code the way you did, so I can improve the documentation. Maybe I just need to strengthen the warnings to stay away from the advanced API unless you absolutely need it.