From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DDF1EB64D7 for ; Tue, 20 Jun 2023 14:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233136AbjFTOgc (ORCPT ); Tue, 20 Jun 2023 10:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbjFTOga (ORCPT ); Tue, 20 Jun 2023 10:36:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1FE1709; Tue, 20 Jun 2023 07:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=E6LUAGD2W9fniJVMeYXWWaWOxjcy8tolmVGdHxej/T4=; b=RYOS+Mf9ZwkRDYzJNRld1VlcV5 rmAj1dKJ1nFSqFYRaLed5du+1YGpRP3Gs0L1Uq9s8TVJbJFj58Q0u6yAbYBBGhow0Z6/lbRVHDJyK M0j1LbliacRMsUQ5NMrTRytiXGTMBMPeSXJFq22Nu5n7O278WJCAp/tFLBuizg0LkM2lSjZw5sVR8 tL2PGtC4PJ1I2tBa0hNCVYRYvc5pa8Ldd0FPTOWGRVeodjtLM7dHBF4wLurTT3SBzSwsgOU9ye2+9 0YvqME3Nz9FG/1QYtnkfeLS2l3MqSJ0yLSeDBL0mClGRZjrqhXWOZObsRZVs8SlNQ7ZFeTJyCYW51 0uCjzr1w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qBcSy-00DBum-Oq; Tue, 20 Jun 2023 14:36:20 +0000 Date: Tue, 20 Jun 2023 15:36:20 +0100 From: Matthew Wilcox To: 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 Message-ID: References: <5728ebda22a723b0eb209ae078e8f132d7b4ac7b.camel@kernel.org> <5f644a24-90b5-a02f-b593-49336e8e0f5a@yandex.ru> <2eb8566726e95a01536b61a3b8d0343379092b94.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jun 20, 2023 at 06:47:31PM +0500, stsp wrote: > > 20.06.2023 18:46, Matthew Wilcox пишет: > > 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 ... > Won't I get the recipient's pid in an > l_pid then? You snipped the part where I pointed out that at times there can be _no_ task that owns it. open a fd, set the lock, pass the fd to another task, exit. until that task calls recvmsg(), no task owns it.