From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 D432236A028 for ; Mon, 23 Feb 2026 19:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771874475; cv=none; b=CTOy3I6Aez6loTFZo6a0qkiRcGZJebgpRbEaZa/MR7/vWxxih5jXdnqBEenFG0GJNPoLziLYAfaCwctz2NSOjCQzLbobSAbfkBaXspxEOq5zZvReSBhgIat42ersg5ku6Qb9yQWw0Uw0sbfpaLGF3vJ1iQUCWQby6RNm+JSL8jU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771874475; c=relaxed/simple; bh=mv8HWzyIGIg6MhXUteEeHEkoA7gYbLpaaLQIe4zi1EE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=shtQnqL84no6RDDvz2I8fBN2/qIERNx8SvHddXe84L/Cc7w662NLMUkqp9KfD9ugvg4kBZtlfwWTG7zcFbptgTAyilJM5T2uIlWf87tbBbCSnwb43NI3o9fEhaFfecUEw3kQZtBf/ybrs8TUNa1ISurCEEsstFfjbbSUw+hmyEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=W39xAOTC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W39xAOTC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771874473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uey1o7KJHXLBYmkBbcXJeg75bnZzGirLrTOQOxehJuI=; b=W39xAOTCM8Hn0M9A7u/WEqfi/8BHMrrUr4xGudIO+PzAxq0vaLXT1TZbMFDjAE5BhS3t46 eQDeRW2+5xFWxUpb2wIl0zIDGVzAk/euJKn5l8FBki7RDc6YEUE6uSlj3H4FUgj2bkblSM CSfJ8GxTLMCoyeUeQjdhkPpF0G+Qoes= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227-wZXFO1oPONaEiK_4EtbUOQ-1; Mon, 23 Feb 2026 14:21:08 -0500 X-MC-Unique: wZXFO1oPONaEiK_4EtbUOQ-1 X-Mimecast-MFC-AGG-ID: wZXFO1oPONaEiK_4EtbUOQ_1771874467 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6DFF41956088; Mon, 23 Feb 2026 19:21:07 +0000 (UTC) Received: from fedora (unknown [10.44.32.38]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id A07CE1955D71; Mon, 23 Feb 2026 19:21:04 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 23 Feb 2026 20:21:06 +0100 (CET) Date: Mon, 23 Feb 2026 20:21:02 +0100 From: Oleg Nesterov To: Christian Brauner Cc: Jann Horn , Linus Torvalds , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: pidfd && O_RDWR Message-ID: References: <20260223-work-pidfs-autoreap-v4-0-e393c08c09d1@kernel.org> <20260223-work-pidfs-autoreap-v4-2-e393c08c09d1@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@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: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 02/23, Oleg Nesterov wrote: > > pidfd_prepare() does pidfs_alloc_file(pid, flags | O_RDWR) and "| O_RDWR" > makes no sense because pidfs_alloc_file() itself does > > flags |= O_RDWR; > > I was going to send the trivial cleanup, but why a pidfs file needs > O_RDWR/FMODE_WRITE ? > > Actually the same question about some anon_inode_getfile_fmode(O_RDWR) > users, for example signalfd.c. perhaps an accidental legacy from 628ff7c1d8d8 ("anonfd: Allow making anon files read-only") ? Oleg.