Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12438410rwd; Fri, 23 Jun 2023 06:13:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WeKxE6Cy7CY2oYVvgilCzrU0RQ38UqvBAUXXOS4xQU2Vv2CDPnxCbRMPsGZ+LTKo5t1xv X-Received: by 2002:a05:6870:98a6:b0:187:8a98:10b3 with SMTP id eg38-20020a05687098a600b001878a9810b3mr19796047oab.45.1687526036093; Fri, 23 Jun 2023 06:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687526036; cv=none; d=google.com; s=arc-20160816; b=hHCr3mNIHfsBictWHbxRmvJBDskkM0R7TLJQNqBPSJ8Xmb7coZB+paq7zwCi5zLmjt z7Iug6zN814GtaqCl5w+lg+OWzNytvf1tHaJ8MBl7lxe01OqqJTPy4+l2ID6dKa9ez3g /1mAOrWAD/FeuFMxo1nzi3jr5C/Y5XlwHLvX00qpy3TKYv9uBNu17UHe5hm+6zbM1mUr EfJyigL0uMdF9iov0QhOW4Ds5euiwZM31sk7pf8u6d1i4jDaibhmP+gEQsEOtxSzbkZ5 JcsEbqaYjywmUnK73TnoozLsHPS/9yX5BPQx+6hbjRV5890AA0Wep6GGRqrtlk4uuyz5 LHgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=h9lyf/2y0b+umHE1S/bdLKnXTLPgTz2Upv/5dRrO6S4=; b=yhazhXI2UlCWd7xq83gh9N4+5MrABvATBsyF/cG9YP9XF3MKEVSVI8LMjWPPVZerro JwuObr0GI8pwH9RIeQB5S2HmA1aVMreSLIkG0JxCfMSQthocFRdo4Qi/2SIjXgaZv4f/ 3VspsPeveCK6OQ99eIiM+J6u5kjaljFyEKpi9KH/el7vMYoLLumJQlzS1nmps62LMVFR VWw4DFKEanTq+dazQ+hLSUZCHjWgz53Di2TDTD4XBQEHVktNegAWGjHOUI60aleTbQO5 pgZKVyKms8oyNNEHKtjjtrrSQZwwUqveAbrEdm3RgV6g2b/PIsZ+ZMYdcIzPpLubjImq tMQQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az9-20020a056a02004900b00542d2508ac8si9083862pgb.89.2023.06.23.06.13.41; Fri, 23 Jun 2023 06:13:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231544AbjFWNKe convert rfc822-to-8bit (ORCPT + 99 others); Fri, 23 Jun 2023 09:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbjFWNKd (ORCPT ); Fri, 23 Jun 2023 09:10:33 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0D92133 for ; Fri, 23 Jun 2023 06:10:30 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-308-LL79zkSiMMOLClOvKXuMbQ-1; Fri, 23 Jun 2023 14:10:27 +0100 X-MC-Unique: LL79zkSiMMOLClOvKXuMbQ-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 23 Jun 2023 14:10:26 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 23 Jun 2023 14:10:26 +0100 From: David Laight To: 'Matthew Wilcox' , stsp CC: Jeff Layton , "linux-kernel@vger.kernel.org" , Chuck Lever , Alexander Viro , Christian Brauner , "linux-fsdevel@vger.kernel.org" Subject: RE: [PATCH 2/3] fd/locks: allow get the lock owner by F_OFD_GETLK Thread-Topic: [PATCH 2/3] fd/locks: allow get the lock owner by F_OFD_GETLK Thread-Index: AQHZo32TC5N9nkgT8E+AvQ/6iJ//gK+YXybw Date: Fri, 23 Jun 2023 13:10:26 +0000 Message-ID: References: <20230620095507.2677463-1-stsp2@yandex.ru> <20230620095507.2677463-3-stsp2@yandex.ru> <5728ebda22a723b0eb209ae078e8f132d7b4ac7b.camel@kernel.org> <5f644a24-90b5-a02f-b593-49336e8e0f5a@yandex.ru> <2eb8566726e95a01536b61a3b8d0343379092b94.camel@kernel.org> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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-kernel@vger.kernel.org From: Matthew Wilcox > Sent: 20 June 2023 14:46 > > 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 ... > who may not even have received the fd yet. Do these locks persist across fork+exec? What happens is a completely unrelated process opens /proc//fd while a lock is held and then the (nominally) lock-holding process closes the fd (or exits). While it might be a useful diagnostic to know the pid of the process that acquired the lock it clearly has no relationship with any process that currently has an fd[] table entry that references the file. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)