Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7837198rwd; Tue, 20 Jun 2023 06:58:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ481pFTngCC+VwFoEVz169+vspYmaUIAsAoQ9z2/it6aZbBlF0NAkp1hm6iCexox2Lnd0pE X-Received: by 2002:a17:90a:c087:b0:25e:91ef:8b24 with SMTP id o7-20020a17090ac08700b0025e91ef8b24mr8370198pjs.24.1687269490310; Tue, 20 Jun 2023 06:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687269490; cv=none; d=google.com; s=arc-20160816; b=icWu21LFlFMFE1sf04QcpGN0nz6pqHnVbYrLnPviZYC/ypP+/69aKEmy52bpnJQsr8 wDXWAHwP4WcfV+p8fbmSbO/YWv4QDXy+hEBEBqpsWY7iQl7SjywWMU6NgH5FdyNWSP0e Mndl9GVwVtr1GCg8SZlEK7aqcm56Fvui4F+GY/SY9Qi3f/cFUXxHGLVQ8Y2LUPG1e+xF ZYGRveYyjC2Z0E7Jz/pbZbABoEf79Ua5X2HAZAosHzuJPhwkRk3jSdvDoBHX7u3FwWZZ /lelducjPlWPopmygXCb414nrcirMPlTjqftrDBZu0T8KvM6XLE+VErGghQgxwWsP2Hn F5bQ== 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=PhlDJFhZ9kE6LkIjRQx8p4TngH1FPLd3OMinLEFLzfY=; b=x0tS5Jt6/8F4vMHGSe9G5YjbPeA6w9cnGS0BV2gv54gGRKpEIXMKJxNe7gD636MQK9 bOzK0DfXnY6M5nh0+VRSPHUU/PMe2xb5senbLD6kRJvCTdtwFOFdlLEsO0hv0e8Y1WaP +k5zFolgNgihQOnZraqruc9FhzE10jcYnQFOXPYxNWCe5aWl4LpaTomezAX7mGgTWM1e P+0c/eTkXlqXH7NjQ6Nsljmr6s/cbKpXoi+Yv9pPF7AWJB7z1MubINgyGK6gEmcIXHjc KaQ3HsUWF7QxWV+U950TWDuhf9hXy8I5vKNLd9hMxBGRqcaX3hfWGuTCLwE5+a89Dye0 VUdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=ItTqvOVq; 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 a11-20020a17090a740b00b00258ee17486bsi1990719pjg.160.2023.06.20.06.57.58; Tue, 20 Jun 2023 06:58:10 -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=ItTqvOVq; 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 S233104AbjFTNju (ORCPT + 99 others); Tue, 20 Jun 2023 09:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233129AbjFTNjh (ORCPT ); Tue, 20 Jun 2023 09:39:37 -0400 Received: from forward101b.mail.yandex.net (forward101b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2FD19B1; Tue, 20 Jun 2023 06:39:22 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1380:0:640:6985:0]) by forward101b.mail.yandex.net (Yandex) with ESMTP id 9061D6010C; Tue, 20 Jun 2023 16:39:09 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 7dhJcbqWm4Y0-WeZ40bE5; Tue, 20 Jun 2023 16:39:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687268348; bh=PhlDJFhZ9kE6LkIjRQx8p4TngH1FPLd3OMinLEFLzfY=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=ItTqvOVqvkCAfiVFI1M31Jkz73JWqryhUEXI9rlV+wp57O8YF7xbVJ4L6z3cuY7O4 Izs8wX1RCYj3ZaXKoQQkObXfDRSUuSZskxEVcI1NQpQXRL/9t9bCbOxO+5XrhuMfx0 C2VFAKxKIGVEEJ0QcObQfzzCjjVSdgXtPKuTE+sM= Authentication-Results: mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Date: Tue, 20 Jun 2023 18:39:07 +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: Jeff Layton , linux-kernel@vger.kernel.org Cc: Chuck Lever , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org 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> 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,RCVD_IN_DNSWL_NONE,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 18:19, Jeff Layton пишет: > The bottom line is that these locks are specifically not owned by a > process, so returning the l_pid field is unreliable (at best). There is > no guarantee that the pid returned will still represent the task that > set the lock. Though it will, for sure, represent the task that _owns_ the lock. > You may want to review this article. They're called "File-private" locks > here, but the name was later changed to "Open file description" (OFD) > locks: > > https://lwn.net/Articles/586904/ > > The rationale for why -1 is reported is noted there. Well, they point to fork() and SCM_RIGHTS. Yes, these 2 beasts can make the same lock owned by more than one process. Yet l_pid returned, is going to be always valid: it will still represent one of the valid owners. So my call is to be brave and just re-consider the conclusion of that article, made 10 years ago! :) Of course if returning just 1 of possibly multiple owners is a problem, then oh well, I'll drop this patch.