Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9156321rwd; Wed, 21 Jun 2023 03:58:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PdZiSTkShAR8nuMZZb8A3o5ZfEcYlpwIldG6qea9mS0eCZ18bc1U6d5HV1FrWohgb8Fc0 X-Received: by 2002:a17:90a:207:b0:25e:aaff:400c with SMTP id c7-20020a17090a020700b0025eaaff400cmr9188802pjc.20.1687345132109; Wed, 21 Jun 2023 03:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687345132; cv=none; d=google.com; s=arc-20160816; b=V+8tXufiOfXIHP1a25NiPz2InJynyTcFbPFDQ4LH9dKlCywVNZxUqxQ7o6753mc9YA e/n4HIAeyeEIfylX7WW4e7Nmd8lEtMj9aRDFXu96yZYZ2cE/3QRDGSVM6RrYlCYXJTVj yz7lOF32J/BOHf8MS6hFjwJ+nYA+n3yvup6iAIIjjcYBsDfiZHNNkFaYx409JiRdLerh PgbSSlmpgGFudJI+EN9nKxb3UBtXZ9GS0WnEpNe3XxBXcpR0B3fFJQyQuKXdzG07Fql8 4K8RthQ/pkjpA/fjeKS5NLbeVu98XhE+9/bO4v/pm6VpUvzJi+2amNvYqUhAb+LjLLst d8lw== 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=apOh63U/ySYLd6SJidE3yth35ZpHrrGe52pobpX3XmY=; b=fQp6YsPiftYBJEo5+EFGzjRvxFWOWG5U2TtBSs47ABdjOX5o7/9+S+5/j1dXKOWUJh di0UPF8Wu8onk0xMKd+C0FaK/w9hvxHJ5DgLNxM/iXtQgjFKmEBc0Pj5SFqn9tGshdmo pfmfO0SpbaS2PI+6iRXhEYmCICa/Me+GniRauBJ60yKt1jVjj2HAA1zekxL1kRdStiTG W9XyPCZsrdHl0jwj/yiu7sedfjKxU0d/8Y94b+X86N5AUFDTBZPR2qO7Gr22yeRD3Git YtsCn/GS5Db9+rCXGvGGOsUtHLZbniiS9VL0nrIYXZDSfaEVQeHMw8yzgdYX5n/pA+lx 9j4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=G+goBNLi; 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 om17-20020a17090b3a9100b002473e331f90si4012146pjb.46.2023.06.21.03.58.38; Wed, 21 Jun 2023 03:58:52 -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=G+goBNLi; 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 S232011AbjFUKpL (ORCPT + 99 others); Wed, 21 Jun 2023 06:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbjFUKoq (ORCPT ); Wed, 21 Jun 2023 06:44:46 -0400 Received: from forward502c.mail.yandex.net (forward502c.mail.yandex.net [178.154.239.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 433FD272C; Wed, 21 Jun 2023 03:42:20 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1e2b:0:640:94b5:0]) by forward502c.mail.yandex.net (Yandex) with ESMTP id B91FD5F08A; Wed, 21 Jun 2023 13:42:17 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id FgficR1DSOs0-cgpcxfB7; Wed, 21 Jun 2023 13:42:16 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687344137; bh=apOh63U/ySYLd6SJidE3yth35ZpHrrGe52pobpX3XmY=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=G+goBNLiFgXVTHOd2qKAwE2UoBHwT0HtWHrxOFRObkYGDrE2yR6vR9kNyInFxboLT T0bO54VYSHPoydICwOFws644LIqRX7s8Y2f+5p+X+9W7M/8tIZTMASAxbksAXNrhPp o7sg/OKTsYUg3oZq92/ZflocvwwDk3+Ap37/VNR8= Authentication-Results: mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <0188af4b-fc74-df61-8e00-5bc81bbcb1cc@yandex.ru> Date: Wed, 21 Jun 2023 15:42:14 +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> <9c0a7cde-da32-bc09-0724-5b1387909d18@yandex.ru> <26dce201000d32fd3ca1ca5b5f8cd4f5ae0b38b2.camel@kernel.org> From: stsp In-Reply-To: <26dce201000d32fd3ca1ca5b5f8cd4f5ae0b38b2.camel@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 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 21.06.2023 15:35, Jeff Layton пишет: > I don't think we can change this at this point. > > 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?