Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9208032rwd; Wed, 21 Jun 2023 04:39:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nTyckvZ0EjV5qD15dzpKasSfEW5yOTBQjQ9l9B/FTV5uNzaptb/v30Uupqw7CQQ0Cg/tK X-Received: by 2002:a05:6808:10d6:b0:39e:e149:bce5 with SMTP id s22-20020a05680810d600b0039ee149bce5mr9316584ois.20.1687347578275; Wed, 21 Jun 2023 04:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687347578; cv=none; d=google.com; s=arc-20160816; b=A2QTmtoj9Qgz26bR5QFjSPv+XmI8OpPh8Bdm3h3Sngt5RHaGueWXDb8XWXkh0tbSsx g4eDrs6YadIwHVgziypPgbmclKBa855keQXH1x0P0HN9PgdxON4rzXpIKgWW1OAyYvy9 pI4b1keuczDnXqb1AxAiwWJU5q9eIbeu+KAW/cs4PCrFO/xPLZBadeAx2fjGLiikmDoU 7L9SsUT1EQucxH+0R0BYQv074d9u4ioHWqj/yGSaj4PpAb87q1pO7COC9ARGaJcMyKuW yjf3Ag4RlfGLP4whTTA+Nj7tkeHyd2wiBtrdmwgh6kjPynDv/dX7bKUoe8gLcKrjnIgn jepg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=OraY5YzpwAEOisjb2wEyx6Nb6K5/CYe1TzmxyoZxTuo=; b=G/58zvu3h+knfc4tKhLBvEdOwWuEh+k8Yu0xQH2ekWgioAq27vE8cNlqE+NaUobCT5 5qtsNCEQVhmJdq8DKeVmns8c/QkuoV3PdVcAB7LzzslHNbFSXNKRz7W6ex9jtux/bsuP j27+oEiGsIdvmIUdXrNFw68CC0sjlbZhrw1+go6nfWiFWw6AOu9B7lJAnp41mSUTd9qC gV4jbk+SaosQzHHEU1QgBULHf0cKu3mwZaNKkoyYisHMHZC5YeRDQn5aSMtffrdmPEyn 75UNbyQukYlpjMyGKzyW7gzL1Th6GBK04XVTbdHvIDkJBBJYnAGBnfVW3xwljEuwmI2Z K4fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jpAXCBEx; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w6-20020a639346000000b005533a94a2fdsi3970547pgm.466.2023.06.21.04.39.23; Wed, 21 Jun 2023 04:39:38 -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=@kernel.org header.s=k20201202 header.b=jpAXCBEx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbjFULFa (ORCPT + 99 others); Wed, 21 Jun 2023 07:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjFULFU (ORCPT ); Wed, 21 Jun 2023 07:05:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3722910F1; Wed, 21 Jun 2023 04:05:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9F4F7614E2; Wed, 21 Jun 2023 11:05:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66CAFC433C8; Wed, 21 Jun 2023 11:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687345514; bh=OraY5YzpwAEOisjb2wEyx6Nb6K5/CYe1TzmxyoZxTuo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=jpAXCBExsHuTSXdF0XCd5GLi5Vtp/AAjI7IXm9E+UaI9ai3JarebATww0T/ReZKrq /vGQa6V4iDkBtMyUnRS1ikPdIFrlDH9LVGUOlhH4kj5GDc/KCkzaRiKvM1tsXvffu+ VAQ8ZIokqnEWvg4WtU4J7sCKGHKDo2FTpwMIsQpdjRre8joU1Pwhk1aO/fGNVeJjtL NHkLHPLGAalMEu9fhNefkNZlo20IKQ6fWxbm0RvACWyK8gn0O202cRvBoIg4NgjkJ+ 8dWC84jQkUmluJpxxYePExih+OxUQ+c9hHVxIWUv7qryOybhFEZZ7ggYedmPRNAaf+ madwqE4HB3bVg== Message-ID: Subject: Re: [PATCH 2/3] fd/locks: allow get the lock owner by F_OFD_GETLK From: Jeff Layton To: stsp , linux-kernel@vger.kernel.org Cc: Chuck Lever , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, Matthew Wilcox Date: Wed, 21 Jun 2023 07:05:12 -0400 In-Reply-To: <0188af4b-fc74-df61-8e00-5bc81bbcb1cc@yandex.ru> 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> <9c0a7cde-da32-bc09-0724-5b1387909d18@yandex.ru> <26dce201000d32fd3ca1ca5b5f8cd4f5ae0b38b2.camel@kernel.org> <0188af4b-fc74-df61-8e00-5bc81bbcb1cc@yandex.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, 2023-06-21 at 15:42 +0500, stsp wrote: > 21.06.2023 15:35, Jeff Layton =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > I don't think we can change this at this point. > >=20 > > The bottom line (again) is that OFD locks are owned by the file > > descriptor (much like with flock()), and since file descriptors can be > > shared across multiple process it's impossible to say that some single > > process owns it. > What's the problem with 2 owners? > Can't you get one of them, rather than > meaningless -1? > Compare this situation with read locks. > They can overlap, so when you get an > info about a read lock (except for the > new F_UNLCK case), you get the info > about *some* of the locks in that range. > In the case of multiple owners, you > likewise get the info about about some > owner. If you iteratively send them a > "please release this lock" message > (eg in a form of SIGKILL), then you > traverse all, and end up with the > lock-free area. > Is there really any problem here? Yes. Ambiguous answers are worse than none at all. What problem are you trying to solve by having F_OFD_GETLK report a pid? --=20 Jeff Layton