Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8046613rwd; Tue, 20 Jun 2023 09:25:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ417ZUQlgz8RY0T+5WhbtxJ+qUkRwykczcw4uIw5ajp93z5NBneZt+7VBfZxWF18q9FyBCx X-Received: by 2002:a17:90a:748f:b0:256:991a:19e with SMTP id p15-20020a17090a748f00b00256991a019emr3307844pjk.9.1687278326826; Tue, 20 Jun 2023 09:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687278326; cv=none; d=google.com; s=arc-20160816; b=JrZ3M9E25vlB/Xy0FVP2dnCtUaKD09nIQH1QFg2I3iSLyo9YUj80x2JuOAon0FPTLO JqHVLYzWVc31WoItgOOCGfjfcf/ypENr6uqOXc10BfCwF0f4TitDNw/TOI9iO22w0a00 n3FD/bpqR9r3h7sHdbjtxx1fWfifb/6hNTTUBIqZsjq6ziO3GYyLmuM39OS47v4wT8SA WdHNEYrSvFRSjaeZNTcjieRDkBy00h9JTL1YOIILkfhPIzgxoi6gzqc6xNc8ZX5D9z7p cZ4GVONnXOy8g6z84BEXQhyRdj/kRtqFeWMTpaRaDZoRun9U/NnjTyMNKGgfQx0Yo6E0 rFgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=UuD0riuPhdFI9gmbnXdcYZ8aN8C45eiZd+yMktkakzg=; b=Ql7EMAqBO4Et6Z1n7v6BkngHIRBTa2cMEpvSMxUqYTowfZlylQ7/jh8JLg+E6WLEE5 JfGl0BMBXAyO2Nzjhrahkgp6epbpelNJhb8bgNEgiWxGFJBG++0N3Gt8sU1E2ig0e80v kbPx9tfacU67RItJtn7iXU7tsOHCQiZKbn7w/COK0YZBpX9h+mN1rKcSYKdfR+1qK4+F oqGQdbOP+9nkxSE3gXx8AHgrmY5MWYkcYgrif8j7NBFUBofBDAeru5ogxHJQf/1IDxZV LzC3/csYeFAkuCLQ6FUYw6EnuE2h8iToxZACImkSX/UYbXlDpMg6TK6aKkTuXEGK6SBJ KQrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b="A/bbPRzs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz6-20020a17090b0ec600b0025eab041423si9403200pjb.189.2023.06.20.09.25.11; Tue, 20 Jun 2023 09:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@yandex.ru header.s=mail header.b="A/bbPRzs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbjFTPpr (ORCPT + 99 others); Tue, 20 Jun 2023 11:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjFTPpk (ORCPT ); Tue, 20 Jun 2023 11:45:40 -0400 Received: from forward500c.mail.yandex.net (forward500c.mail.yandex.net [178.154.239.208]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA74210C2; Tue, 20 Jun 2023 08:45:33 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-39.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-39.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:2087:0:640:7bf5:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id 1A4E85F00E; Tue, 20 Jun 2023 18:45:24 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-39.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id LjjMmjuDReA0-6OlYo5Rk; Tue, 20 Jun 2023 18:45:23 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687275923; bh=UuD0riuPhdFI9gmbnXdcYZ8aN8C45eiZd+yMktkakzg=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=A/bbPRzs8UL2499Pjm/08MN/N7QX0uHCqVJy6PqV0aCBsMlyrGRyMvDqtrwbZQIjJ Fam6hbx4WNy7im177p5dWh5QCHSDFt8EG3AhJtKo4Vqk8TIxVnmtOKmmeXyxh4hroz nkjW/NLSp66pwUmBB9ohyQab+1gsTC+Tx4mCNz2I= Authentication-Results: mail-nwsmtp-smtp-production-main-39.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <08612562-d2d7-a931-0c40-c401fff772c7@yandex.ru> Date: Tue, 20 Jun 2023 20:45:21 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/3] fd/locks: allow get the lock owner by F_OFD_GETLK Content-Language: en-US To: Matthew Wilcox Cc: Jeff Layton , linux-kernel@vger.kernel.org, Chuck Lever , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org References: <5728ebda22a723b0eb209ae078e8f132d7b4ac7b.camel@kernel.org> <5f644a24-90b5-a02f-b593-49336e8e0f5a@yandex.ru> <2eb8566726e95a01536b61a3b8d0343379092b94.camel@kernel.org> From: stsp In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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-kernel@vger.kernel.org 20.06.2023 19:36, Matthew Wilcox пишет: > On Tue, Jun 20, 2023 at 06:47:31PM +0500, stsp wrote: >> 20.06.2023 18:46, Matthew Wilcox пишет: >>> On Tue, Jun 20, 2023 at 06:39:07PM +0500, stsp wrote: >>>> Though it will, for sure, represent the >>>> task that _owns_ the lock. >>> No, it *DOESN'T*. I can open a file, SCM_RIGHTS pass it to another task >>> and then exit. Now the only owner of that lock is the recipient ... >> Won't I get the recipient's pid in an >> l_pid then? > You snipped the part where I pointed out that at times there can be > _no_ task that owns it. open a fd, set the lock, pass the fd to another > task, exit. until that task calls recvmsg(), no task owns it. Hmm, interesting case. So at least it seems if recipient also exits, then the untransferred fd gets closed. Does this mean, by any chance, that the recipient actually owns an fd before recvmsg() is done?