Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8957811rwd; Wed, 21 Jun 2023 00:47:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5n/XXB72PHOBgZ/VXILTWTOwZOUOtUSG11s+HvfpvX2tlHLP1IPY/N7qZbU++lN+9D6Iyf X-Received: by 2002:a05:6a20:428b:b0:122:2bc1:8857 with SMTP id o11-20020a056a20428b00b001222bc18857mr7331945pzj.52.1687333641534; Wed, 21 Jun 2023 00:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687333641; cv=none; d=google.com; s=arc-20160816; b=qztNUAZ2vc9ebs2dMqWAC3GT1yEyQVLI3jaTL2h9mfHdx61Rkn0k7ndsUyhzAxWodv RTO+xJvP+lp582A2m4+p+2WfferDoWuala885K1A64Wl5/3MK72hLtGIN1eNjDut9Eb4 /NrPEdZoLPWe/45ZbbzVBPhBjpaEvMK2cBzKIPxQ8jg2lufZMCJZI2RaM61NhnDu/GUH eOgZMrmr7oy/NnmJYu9enZYugawFNi24YF5kr9s5q5AR2igWxRxQzIB7fqnfjWhcr+po b4N/QM04ni2bo6zRaygd3iqUgm8wP5nRjRDPT4vadb7sNSLNjjEht2IsV33GvuJ9j4EI GYPg== 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=kxzsLoKA52whM2CNNdp6u6lW2oEAbMirlOhxND1ozNU=; b=EtBNqDijPHKjtEF80b/aTK9Hn7+w6EAI5Yb4n+w5Fro1juTo5AH4kJX8Jn9gfO6lGz DpGrn3MJF1URZh+stWA2hCcE5pQL1HWANklmnLzIO5PPVzs9g0ew4yFQNmH5rc4TIc1P EsOvWXlQVRK5SMw+g4Iu5/cIJOvVkvjWFFIB6aTJg+x1SOvU5nIulyXhbQXhRVD4H4x2 SIfRMs02vDiA0xMEzVFS/TgsJfAMTdUzQoHOWm3y/oNSh8MY91C7RblnNErsJuLZAj/3 uZwZUVd9hNKC+POZcROiS8hrq5anLhu21ytx+78TAQkUv7H53fIFz4HSGAK3/K74MrCn qTjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=rnKGwgAt; 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 s125-20020a637783000000b00502ee712648si3419742pgc.578.2023.06.21.00.47.06; Wed, 21 Jun 2023 00:47:21 -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=rnKGwgAt; 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 S230324AbjFUG5z (ORCPT + 99 others); Wed, 21 Jun 2023 02:57:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjFUG5x (ORCPT ); Wed, 21 Jun 2023 02:57:53 -0400 Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [178.154.239.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E978DD; Tue, 20 Jun 2023 23:57:50 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:2891:0:640:3c15:0]) by forward502b.mail.yandex.net (Yandex) with ESMTP id 39EBF5F12E; Wed, 21 Jun 2023 09:57:48 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id jvbXS14DTW20-atpQLnyJ; Wed, 21 Jun 2023 09:57:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687330667; bh=kxzsLoKA52whM2CNNdp6u6lW2oEAbMirlOhxND1ozNU=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=rnKGwgAt9Y5Zmj5F3Vr2pCBnNnbADgDgVVh7miTiFIybPeTsrLr0hmiZDgBodh+Yy QgdSPSPsPrKRgLOA0xx1dghOzU2WNb+jalPoHRs3gvhLO6OBWRrHJ+FXZ4OuQALmxg hu0t3Cts+//4WxMXoU7If5NXtezjenZ7mqPdo72U= Authentication-Results: mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <9c0a7cde-da32-bc09-0724-5b1387909d18@yandex.ru> Date: Wed, 21 Jun 2023 11:57:45 +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, Matthew Wilcox 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,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:58, Jeff Layton пишет: > No, it won't. The l_pid field is populated from the file_lock->fl_pid. > That field is set when the lock is set, and never updated. So it's quite > possible for F_GETLK to return the pid of a process that no longer > exists. > > In principle, we could try to address that by changing how we track lock > ownership, but that's a fairly major overhaul, and I'm not clear on any > use-cases where that matters. OK, in this case I'll just put a comments into the code, summarizing the info I got from you and Matthew. Thanks guys for all the info, its very helpful. Now I only need to convert the current "fundamental problem" attitude into a "not implemented yet" via the code comment. >> So my call is to be brave and just re-consider >> the conclusion of that article, made 10 years >> ago! :) >> > I think my foot has too many bullet wounds for that sort of bravery. I am perfectly fine with leaving this thing unimplemented. But what really bothers me is the posix proposal, which I think was done. Please tell me it allows fixing fl_pid in the future (rather than to mandate -1), and I am calm.