Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp557445pxb; Wed, 3 Feb 2021 11:35:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqAet+DyVGKznlfqK7h7j96ojcx8Arl7aGAGnbjrt6WNUlrIAqSTkEDWdMnd+RizQQV1Q4 X-Received: by 2002:a17:906:8591:: with SMTP id v17mr451131ejx.30.1612380942467; Wed, 03 Feb 2021 11:35:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612380942; cv=none; d=google.com; s=arc-20160816; b=urImVkAxgkuku79av730R1bhwvDX6rtidJ84r5+o+QwrhhH0EZDhQb58BUnAPaUryH /tw2LHDHSqj62H9nIeGMhuvuIMSeAwPGBC4fNyp2iBm6hrSlNn/XnPJ+/T9YcYZbQYPa 10yG7eQ/13DTLubs9n89Nv8H/qhUOoNY67lkWXNxUgUY4/Yp/0ShRh/aunmKgO+z4/Np Fgfe3tPA/akPVEnQlbMF3Kd1w9PEPKPcv7iIhIZdMLTQ/dZtBTcnkJKjZ64NxeD359Ao tBb2cq+hw/fuUo7REY6AroCLjpLKaLxXG42G1Wv+6ZfrGGSnS7aJcWfI9Y/WxrpFC2HS 2a0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tcLZknCefIdroLnvwaZu4BA8cKkKANxIH89d6baPmQU=; b=vxUB/uVEbJ2xe9hlvB16x/UO619ynrPc9daTOPRcPFbjDvvdhtzXvUyVHWrUjbD/T2 3bg7iEyWT5LQ9vF6/Kp02wwOWV5A/BT1/KlipwXwDbwjj73Dyzw27cTApx+V7NJkO8UF 4N5y3iNLcxYGJl81bAjbtYxxhuvDkapqYb/MIE6ziRRHsY/k5/zUkoe8gnauj45M4iCX gQ9TUWVIWET/mJVdfLZkQcDe7YVbeFfB9ru+Wskp5OFnFpSwuQmSnkphmn0MtNsdadWp tYWBICvmYozOY9cENmqsZTNWF/4j9334BalMHglvl9BNDgl8HgR/HaI9vgWPyo6m+B9X ijxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KqrMrj7E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si2093699ejy.10.2021.02.03.11.35.17; Wed, 03 Feb 2021 11:35:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KqrMrj7E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhBCTcr (ORCPT + 99 others); Wed, 3 Feb 2021 14:32:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbhBCTcp (ORCPT ); Wed, 3 Feb 2021 14:32:45 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B3FC0613D6; Wed, 3 Feb 2021 11:32:05 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id v24so848565lfr.7; Wed, 03 Feb 2021 11:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tcLZknCefIdroLnvwaZu4BA8cKkKANxIH89d6baPmQU=; b=KqrMrj7EbDc5JQQ8mfnTpsd7o6+bi6L3ZQtKF2kLlEw3S1GICznZFnGdtJOQBP2Uco Ks3hwsLM8JmQs4TJzBE/ar/ueC8bhEnzly25SH8iLnlBr8CI+wOkeY10fPOMccqU8kG+ YK1EBHKxaceT+WcbiSq2S1MKVfw8O/W9kPVx87vlVr1r4TlSvSa6IoVREPPntmp3EcPi +MHveAbdqCAvWDl5BjVixnUykJ87z5citpPoMvUy7pJzo8p0Te3cE7NY8GRBHMB+65pK IuuMPquQDv6ys8CZZQmMr6hr7UP6pmUCRRzco1Z9sl8ks88TBxMXnIg7U95JPPfYhDGo NaYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tcLZknCefIdroLnvwaZu4BA8cKkKANxIH89d6baPmQU=; b=kdjL/0g3B1rhjWw6/Id8oPRedfRV0uLV+jfIq5HtUcPC4iED95dHiR/RMmcC8fRF9q LzDuqcoCQFYp4vSdGNQ2LvpHTT6ijlolXU7VF3kk0Uss+APdKSoBAeUHjOAaOpgxUMJl fTjrax5xiA/bXCORBhlptZ3KJNEmsux1UnLL31ZCcG79809I7yDQwiNOT+zgR7qYjIGk wJ1TJ+R77PNGXsyXRcM43iJgg/S0bRntU4NZNdCZo8NNfHXvVLem6oTjYR3mohTegOVU 62X62QRFDN+niNrJsmS7IkX17Ul3gAwYReVF8lqwkKFa3xHJrDRK1Z5Dt9VOKgWioJNL q9Gw== X-Gm-Message-State: AOAM5316B8T+WRaXQw9xI+id3KA2QeZagdh/KDFHJG8nN+as/ZDRLWMV r2pmmQhYdnbcMQyWMYoVgic= X-Received: by 2002:a19:22cb:: with SMTP id i194mr2616917lfi.25.1612380723483; Wed, 03 Feb 2021 11:32:03 -0800 (PST) Received: from grain.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id q190sm348257ljb.8.2021.02.03.11.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 11:32:02 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 77B8F560088; Wed, 3 Feb 2021 22:32:01 +0300 (MSK) Date: Wed, 3 Feb 2021 22:32:01 +0300 From: Cyrill Gorcunov To: Pavel Tikhomirov Cc: Jeff Layton , Jeff Layton , "J. Bruce Fields" , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrei Vagin Subject: Re: [PATCH] fcntl: make F_GETOWN(EX) return 0 on dead owner task Message-ID: <20210203193201.GD2172@grain> References: <20210203124156.425775-1-ptikhomirov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203124156.425775-1-ptikhomirov@virtuozzo.com> User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 03:41:56PM +0300, Pavel Tikhomirov wrote: > Currently there is no way to differentiate the file with alive owner > from the file with dead owner but pid of the owner reused. That's why > CRIU can't actually know if it needs to restore file owner or not, > because if it restores owner but actual owner was dead, this can > introduce unexpected signals to the "false"-owner (which reused the > pid). Hi! Thanks for the patch. You know I manage to forget the fowner internals. Could you please enlighten me -- when owner is set with some pid we do f_setown_ex __f_setown f_modown filp->f_owner.pid = get_pid(pid); Thus pid get refcount incremented. Then the owner exits but refcounter should be still up and running and pid should not be reused, no? Or I miss something obvious? The patch itself looks ok on a first glance.