Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3209946rdb; Tue, 6 Feb 2024 10:09:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLDgZaVDsfRSw21iQ6nk3yHFmrNF/Ye24EG3SuAaN0ayk5G7v1qYnSEUl21gtng3QGaJXz X-Received: by 2002:a17:907:75e1:b0:a27:6570:adbc with SMTP id jz1-20020a17090775e100b00a276570adbcmr2463745ejc.33.1707242989332; Tue, 06 Feb 2024 10:09:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707242989; cv=pass; d=google.com; s=arc-20160816; b=CwOxu2QK7A7BNPOet8/kq7YqCIt+8aG6Mb5REAoNXjg1haNuMSSVJt+tkii8fS60vE a510bxNP4a+OD2G5yFj1CyBQp0np7gJRcfcP6UK1A47NePsloNgW922R0TpwbePfSxAK /k3R1M06pROJLgcS5gZmlUF2f+ukppIdhHCvTT6u+4eajndNUSg4hIYtwNWE+zF0gS8y 5u895uuvYFRn7zbfMPzcw8NDK2PeZ6reAm3PeV+sO+Vhg3PhSf2qeImtsHz+29NSzyzJ QwZ5pypAZe7tmTRCzWQ9uh7Av++khixnh5y6UDWW25tllROQN4hZkVYzAWwUFwQsOcy2 Lcqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=DB8DBh1GEyXCan3X4jjSpE9brtS6cbZs50FHQuPtbpc=; fh=pFeMO7eOS4Y7bCogVV/LXASIBlg7eY5KdestPKTSCbw=; b=y0y2wj1DwAXB3kHnyywuLzgjZc/BAR7CaQIfhNMvITpz+BAbCfGyImvQ/7vFbcVwF2 16ymGZG9wsfTHDK8DvWZmJPOlF02i2GGHu5AJZoH7zEsPYY1aHwbVLiCwoZwRJWEp/NB RzXzbxUl3lcTUOSgl9B/MPajDfcCoPd6tWtw/6XlzgPi0eSE136X362mfRoI3Nicjjim wjA+uFAyiN8BHnE9TQ1S6yta3NVwiyUD+3G9iJ2RQW6u+rep89YXSsDv5nT1DqFaVWVj 7dlxv3HN0z+aBY87IB8GTn1r/qyFBhIAuHjMq63czJYL90sL7Yvwq5Q8AQWV/iUljsLr zp4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=Plphh40t; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=F5y8dXUx; arc=pass (i=1 spf=pass spfdomain=tycho.pizza dkim=pass dkdomain=tycho.pizza dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-55440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55440-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUvzSlyE6fk0HgZsYiMgNngn1IjXJaznqpvWats7jQyNp+rYHGgbILzRoVl4RCuXzk+UH1MZtSbvwc+lQ2ezLNt9bB4Ajzn2HsAm0r+fA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i26-20020a1709063c5a00b00a37ccd08fd9si1303598ejg.746.2024.02.06.10.09.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 10:09:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=Plphh40t; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=F5y8dXUx; arc=pass (i=1 spf=pass spfdomain=tycho.pizza dkim=pass dkdomain=tycho.pizza dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-55440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55440-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BF0931F2772A for ; Tue, 6 Feb 2024 18:09:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC2F6101CE; Tue, 6 Feb 2024 18:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tycho.pizza header.i=@tycho.pizza header.b="Plphh40t"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="F5y8dXUx" Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B96B1134A5; Tue, 6 Feb 2024 18:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.27 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707242979; cv=none; b=elk/DYAOfDUrSA18RO9Sr1Y9ovlZe7+Qrf6CwOLmUqY6M+kGTo+7jf1t4bgekCvXP8AJWQsIuVjmKMeshPFvrotYsIWBPQ87d1zBHPvclutxuXLkUdLWDhcJgGQBH4ByZsJVeRS5wlVJrlAPxLPdJOZnyKnNpzlIuefJKsxucDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707242979; c=relaxed/simple; bh=Lkzj1Ayc+R4RiqSI0SS6Fu/wooUtrvulT1004AeJ7Ag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ob5D8W8hUJFX1uq6oRCP4f2zZc9RQ/u9dVb0FNadiXLIA0kSDBV7I1p6MdpwJLVWQxsQKSqvXdVCqrqxVTwnMXmN8CWjQeAJw2Zo0ck/cYQnApeX2XHl5qJjfJjiESDf3/txxff7kMVoav+Um5QWiaFIwcMo0TT8qGqAdaSwkhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tycho.pizza; spf=pass smtp.mailfrom=tycho.pizza; dkim=pass (2048-bit key) header.d=tycho.pizza header.i=@tycho.pizza header.b=Plphh40t; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=F5y8dXUx; arc=none smtp.client-ip=66.111.4.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tycho.pizza Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tycho.pizza Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 9500D5C01F0; Tue, 6 Feb 2024 13:09:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 06 Feb 2024 13:09:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1707242976; x=1707329376; bh=DB8DBh1GEy XCan3X4jjSpE9brtS6cbZs50FHQuPtbpc=; b=Plphh40tfqSto1OziocEInZ/vR QGd3hq3SQij4/SMfcurwsPyR2E7qj8796xDg1dn4TtpIgRdyhPAUquQ5MqMgRe2h XA6hAgZH1RObcm6A3hlHoC2Y3/ReFrnQVnKBm6Ai+nJaS01hwMLRTmHLfchwdZgP lCtZ5WxsKlgOlhlVv4y4U2+PR8wGpwm7Au40tjcQRZd7375mbOGIkrBxOcz4aD1f sLzUfollZfjEy0N6NElyMW34dVkKjpiuKqoWUwk3TCEKi2feEW2EtGloRwK+j+fc 4c3uUJZ1XMr1zOdKctJMZrzxRyg8ztSslXLUpnwtmLYL2QV1pBrt5L8EQfZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707242976; x=1707329376; bh=DB8DBh1GEyXCan3X4jjSpE9brtS6 cbZs50FHQuPtbpc=; b=F5y8dXUxDhfEIRxpnPgFsbIZ+30DW0hj8eeB6QjRltRD d8z4yt8NRwG/7O/8aadXfGEmStivn8AEKSXKCGhiexDvswKpEbKblFWcA4Roz8AR 9PUbd7cGMhi9KpD1dJ46/OJOwMjkGHuR6JUBmWhDYuyoX+3B+VZ2TmHObe374XqW bjkRpqhkoFV/OluSyk19qymTL/FuWRjaYBZEh0ZF9x1yhle+IkkJp0fl5znD/C36 hesOU60ClAKvs2zcwMl4w8lWGFhzKG0gBIzTRqssFn/9g5LeCUh65r8r6V+gaTtt /woOW7bquWXbvvavkEL3VD2iQSysBD8wq9Ldg5EMug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrtddtgdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefvhigthhho ucetnhguvghrshgvnhcuoehthigthhhosehthigthhhordhpihiiiigrqeenucggtffrrg htthgvrhhnpeeutedttefgjeefffehffffkeejueevieefudelgeejuddtfeffteeklefh leelteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hthigthhhosehthigthhhordhpihiiiigr X-ME-Proxy: Feedback-ID: i21f147d5:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Feb 2024 13:09:35 -0500 (EST) Date: Tue, 6 Feb 2024 11:09:34 -0700 From: Tycho Andersen To: Oleg Nesterov Cc: Christian Brauner , "Eric W . Biederman" , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Tycho Andersen Subject: Re: [PATCH] pidfd: getfd should always report ESRCH if a task is exiting Message-ID: References: <20240206164308.62620-1-tycho@tycho.pizza> <20240206173722.GA3593@redhat.com> <20240206180607.GB3593@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240206180607.GB3593@redhat.com> On Tue, Feb 06, 2024 at 07:06:07PM +0100, Oleg Nesterov wrote: > Or we can check task->files != NULL rather than PF_EXITING. > > To me this looks even better, but looks more confusing without a comment. > OTOH, imo this needs a comment anyway ;) I thought about this, but I didn't really understand the null check in exit_files(); if it can really be called more than once, are there other cases where task->files == NULL that we really should report EBADF? Tycho