Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1202289ybc; Tue, 19 Nov 2019 16:35:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxbsfAuZmrNMNizVsFz8SFQBdqTG90ArDK7QFoBxsCvuXm2qrrqTgT8n9pA8a0QI+hB45Zh X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr880239ejb.157.1574210106786; Tue, 19 Nov 2019 16:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574210106; cv=none; d=google.com; s=arc-20160816; b=jUdKj49YXcDP66xs2qrQnvPfQHBtR6siM3u4AA+V3N+ajypt8/FzYQg2B6klpmDhCF cus1t4uL1oR+oODYZkG+FLry6WtFGk3ourl9YEi8heVafkEpoblTyMQpr5LmQf0hQRCQ qANN8oQO87V+ifxYUPaZSJ6cXkIn45qFQq17evYjeZjOqk26OwWlhgRqIxDLN+jJxfZK 2uh2mbSXO9wAOUSLWrjf0DgijlIwzwU+fdTmvUUE9JwORcXHnkRZqwG2CV14/YEoYXDg FSN0giUcZCBeHQktB5OzHEtrsSD12Dlzw5Dmxu33Ipn45WuBBoQ12gVDMjhiyiry+M0j GP+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E76BfeULL9Cj6fUQJlzoEE7JObAbPKX1tHKrIvwvWtc=; b=LRavX0h+Pe4X3Rb7Wfc0Ah2tvQ2C9C0xKcUq44nkO9S29kLF58Zzr/2WhVfTr6chhs hqz5BqWY7r47CANurGbbZKT7bqYqP9UYdqHzp9U2FrYXmYlXV3+A78ACy77ksoc0uglH t+99tV7b6OA3GS3MPAOy8T2txnvDuSCkctp+Hd25TGXfnK8yWMfZFK0n81aKI3QNjgQh +ZQ6C/3L4RlBJU0tJe3OqwfCGowUNSW70vJMVa5XtwGvrsMaE1l9Qsq9cCdf0m3wY1jh Paqyl/Hfm+zQmdEsymggU+vB+/u4N2nYymEpMK9AW87PZRTgRZxzAfPePKBcQ6GpLtZt NbNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kai3gI91; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id t27si14577606edd.304.2019.11.19.16.34.41; Tue, 19 Nov 2019 16:35:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kai3gI91; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727436AbfKTAd0 (ORCPT + 99 others); Tue, 19 Nov 2019 19:33:26 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33867 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbfKTAd0 (ORCPT ); Tue, 19 Nov 2019 19:33:26 -0500 Received: by mail-wr1-f68.google.com with SMTP id e6so26112090wrw.1; Tue, 19 Nov 2019 16:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E76BfeULL9Cj6fUQJlzoEE7JObAbPKX1tHKrIvwvWtc=; b=Kai3gI91KW3k6mk/gVuFEww7JRPmlzJx9VDlRh96Kaqt5GDq9QcGBAegy9tNpvRgWd ihR1QBR1/UJ2MCSfrFqmX82N0dUMiNGuEVs6YGBFhrJhpq8LzgnLbx2MxrrRM5jJqCjS Dn3nXjagcSoBnZBzbjN1gb5Y74KKSYVXxtYV0xexRM/5sdnpr6ta7Ub4ME83E/lvPniZ 8btvSgFUOC3waF9vt2wNt+kiykYTImEsyHK0t5bWhZkS/sRdEwUP9cQ7b+cM8Ji0dfJ6 gUJxfYkEli/fW57aWMABFbHdUjGMChYRBtX0gr5kKUspKCU1t3ebAruL+o1Z7Deue5Lu 0bvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E76BfeULL9Cj6fUQJlzoEE7JObAbPKX1tHKrIvwvWtc=; b=KllBL1PRY/bPwMa3T4N7KwQboazget3d2ZbYLBwCNA7FbC9CIVuBdXoQASTLYwnNb2 g48XrLDEIPE2QurZ1/5LeYOFtLqcIPi+J+d9J/rCVSxG8rq1UsGQYJOddo4p8fF2epyt E2WWGZkNxO6SUUUGRiQiKULD0IZmtxNrc1JdHPHmug7G80m5NXj/pFCzzqPhJhp4nZtc a8DmAvBYILSf+ANzR8M1L4q4Mv+4jFGIysArsRswNDx+jgeiGk2R7pSOpYvwtfhgcRvo hbKNAwkHTlhy2v7991DUfWPrVCl0LADyzZVk4QFHUwxs/wgl0J6w03kzdJ5ETHd3Bymq S8yg== X-Gm-Message-State: APjAAAVSDOQvKpvUHiYUM6G6vrp7qvp2OFsoSkwWW93SNmnOiJwhNVP2 Yqx+ePAnkuDPhmB+PzHxngZEbcDK X-Received: by 2002:adf:f743:: with SMTP id z3mr200071wrp.200.1574210004048; Tue, 19 Nov 2019 16:33:24 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:40e1:9900:5dce:1599:e3b5:7d61]) by smtp.gmail.com with ESMTPSA id r25sm4828947wmh.6.2019.11.19.16.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 16:33:23 -0800 (PST) From: Luc Van Oostenryck To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Luc Van Oostenryck , Joel Fernandes , Christian Brauner , Christian Brauner Subject: [PATCH v2] fork: fix pidfd_poll()'s return type Date: Wed, 20 Nov 2019 01:33:20 +0100 Message-Id: <20191120003320.31138-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191120002145.skgtkx2f5dxagx4f@wittgenstein> References: <20191120002145.skgtkx2f5dxagx4f@wittgenstein> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pidfd_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type. Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t. Fixes: b53b0b9d9a61 ("pidfd: add polling support") Cc: Joel Fernandes (Google) Cc: Christian Brauner Cc: stable@vger.kernel.org # 5.3 Signed-off-by: Luc Van Oostenryck Reviewed-by: Christian Brauner --- kernel/fork.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 55af6931c6ec..13b38794efb5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1708,11 +1708,11 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f) /* * Poll support for process exit notification. */ -static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts) +static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts) { struct task_struct *task; struct pid *pid = file->private_data; - int poll_flags = 0; + __poll_t poll_flags = 0; poll_wait(file, &pid->wait_pidfd, pts); @@ -1724,7 +1724,7 @@ static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts) * group, then poll(2) should block, similar to the wait(2) family. */ if (!task || (task->exit_state && thread_group_empty(task))) - poll_flags = POLLIN | POLLRDNORM; + poll_flags = EPOLLIN | EPOLLRDNORM; rcu_read_unlock(); return poll_flags; -- 2.24.0