From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B5EFC433FE for ; Fri, 11 Dec 2020 19:15:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DD332405A for ; Fri, 11 Dec 2020 19:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405381AbgLKRat (ORCPT ); Fri, 11 Dec 2020 12:30:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405184AbgLKRaQ (ORCPT ); Fri, 11 Dec 2020 12:30:16 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58301C0613CF for ; Fri, 11 Dec 2020 09:29:36 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1knmEV-000avt-3P; Fri, 11 Dec 2020 17:29:31 +0000 Date: Fri, 11 Dec 2020 17:29:31 +0000 From: Al Viro To: Linus Torvalds Cc: Jens Axboe , linux-fsdevel Subject: Re: [PATCH 1/2] fs: add support for LOOKUP_NONBLOCK Message-ID: <20201211172931.GY3579531@ZenIV.linux.org.uk> References: <20201210200114.525026-1-axboe@kernel.dk> <20201210200114.525026-2-axboe@kernel.dk> <20201211023555.GV3579531@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Dec 11, 2020 at 09:21:20AM -0800, Linus Torvalds wrote: > On Fri, Dec 11, 2020 at 7:57 AM Jens Axboe wrote: > > > > On 12/10/20 7:35 PM, Al Viro wrote: > > > _IF_ for some theoretical exercise you want to do "lookup without dropping > > > out of RCU", just add a flag that has unlazy_walk() fail. With -ECHILD. > > > Strip it away in complete_walk() and have path_init() with that flag > > > and without LOOKUP_RCU fail with -EAGAIN. All there is to it. > > > > Thanks Al, that makes for an easier implementation. I like that suggestion, > > boils it down to just three hunks (see below). > > Ooh. Yes, very nice. Except for the wrong order in path_init() - the check should go _before_ if (!*s) flags &= ~LOOKUP_RCU; for obvious reasons. Again, that part is trivial - what to do with do_open()/open_last_lookups() is where the nastiness will be. Basically, it makes sure we bail out in cases when lookup itself would've blocked, but it does *not* bail out when equally heavy (and unlikely) blocking sources hit past the complete_walk(). Which makes it rather useless for the caller, unless we get logics added to that part as well. And _that_ I want to see before we commit to anything.