Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2244241ioo; Mon, 23 May 2022 13:42:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjdhrU76ZughDpCA5bY/Yn7jJ3RvKfM5CoLzsxfBjUbwef+H8XYaAts1A4tboCOrDWBgwK X-Received: by 2002:a17:906:3958:b0:6fe:90ef:c4b with SMTP id g24-20020a170906395800b006fe90ef0c4bmr21724528eje.36.1653338562821; Mon, 23 May 2022 13:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653338562; cv=none; d=google.com; s=arc-20160816; b=rzKt+8oW6Yy+wFxId8hRmctk0KyYPhdLn5O21POoJMsyX8nKVxCR9Btc8ew+ZRQXe2 ZJnfwu0yUnD7qEu4RxcRGOetZZHnVu5fcRriWOyr10R2aibZqOmV6E3Erz9m3UR2m2gF iaM2Tu3zM72a1aAb53YwGbCosdkhFHeF006WdEgdLFDEWwchk3IutaxAEWAJP9g3Wbz5 UTV+yD8+mEuNUciNBpLTECPrspn0ky5c5miIgmSgyfKpa/h7FD96VKWbhmi/tIC+pjLa R0SksdoF8jJb0ta9xvAYGd/EXpMaxg6QG4pi/vBxfReTjBe4d+gEWLPM5T5ijpAPCM1u K2yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:from:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date :dkim-signature:dkim-filter; bh=LZjNK0QJZx0VwySuAQN+c/fv9SRXsDo1siBlZtPr5Y4=; b=hh5eArvYgOqgKTUQt9n2fhamonmwYOKsbcU1tax1iU8w623rR/VZsTsZMuPM0Gdfsb J4ZsQjqc5HuTB1M1QpJ7+uA5pCp5wvfT1ifCfiqGcyFnZhR+VnZK2WG7QwJEOLm8sbke pMuGnU2m1uvkySG06rXBm+qBtpOXLFZ4LKhH8PEsU0Cl3Y5OqZrvoLasvR70/FS5bO6o d4HtQeaSoq5N2e0dNYDrKRuO0vAzoJnu1mCAVQUzKYOPf3G9p8QTexRpCofmLTfKpT86 bj+x5l/jGEtExQVM+AUBSsIdn0Gf8xzrUKj1GVXnqiwEUwyjBJNcY6BMyTlkV4mwuCRp n4SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b="wed4/WjB"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fieldses.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg15-20020a170907a40f00b006f37ff30509si17154490ejc.508.2022.05.23.13.42.06; Mon, 23 May 2022 13:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b="wed4/WjB"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fieldses.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbiEWUR6 (ORCPT + 99 others); Mon, 23 May 2022 16:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232782AbiEWURz (ORCPT ); Mon, 23 May 2022 16:17:55 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F864B0D17 for ; Mon, 23 May 2022 13:17:53 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 884015BD0; Mon, 23 May 2022 16:17:52 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 884015BD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1653337072; bh=LZjNK0QJZx0VwySuAQN+c/fv9SRXsDo1siBlZtPr5Y4=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=wed4/WjBcDf9m5s0RzrNvhl5floK1KDX4fNxwijOC+84pmP+pxHHjW7IAf3z/vQpg yL8xnOXHhbFwg8CPt2fzjPKtpz5t6Hxv4Vcf1SdjM2Z0trJfOUMqMk0OoXDnlwd6ci lLfURV7hg7OT8g/0mPLAiFKEKEFmB9BrJW/vBJ40= Date: Mon, 23 May 2022 16:17:52 -0400 To: Jeff Layton Cc: Chuck Lever III , Linux NFS Mailing List Subject: Re: [PATCH RFC] NFSD: Fix possible sleep during nfsd4_release_lockowner() Message-ID: <20220523201752.GI24163@fieldses.org> References: <165323344948.2381.7808135229977810927.stgit@bazille.1015granger.net> <510282CB-38D3-438A-AF8A-9AC2519FCEF7@oracle.com> <1A37E2B5-8113-48D6-AF7C-5381F364D99E@oracle.com> <9D7CE6C9-579D-4DF3-9425-4CE0099E75E0@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, May 23, 2022 at 03:43:28PM -0400, Jeff Layton wrote: > On Mon, 2022-05-23 at 19:35 +0000, Chuck Lever III wrote: > > > > > On May 23, 2022, at 1:38 PM, Jeff Layton wrote: > > > > > > On Mon, 2022-05-23 at 17:25 +0000, Chuck Lever III wrote: > > > > > > > > > On May 23, 2022, at 12:37 PM, Jeff Layton wrote: > > > > > > > > > > His suggestion was just to keep a counter in the lockowner of how many > > > > > locks are associated with it. That seems like a good suggestion, though > > > > > you'd probably need to add a parameter to lm_get_owner to indicate > > > > > whether you were adding a new lock or just doing a conflock copy. > > > > > > > > locks_copy_conflock() would need to take a boolean parameter > > > > that callers would set when they actually manipulate a lock. > > > > > > > > > > Yep. You'd also have to add a bool arg to lm_put_owner so that you know > > > whether you need to decrement the counter. > > > > It's the lm_put_owner() side that looks less than straightforward. > > Suggestions and advice welcome there. > > > > Maybe add a new fl_flags value that indicates that a particular lock is > a conflock and not a lock record? Then locks_release_private could use > that to pass the appropriate argument to lm_put_owner. > > That's probably simpler overall than trying to audit all of the > locks_free_lock callers. Should conflock parameters really be represented by file_lock structures at all? It always seemed a little wrong to me. But, that's a bit of derail, apologies. --b.