Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp730138ybh; Wed, 18 Mar 2020 08:07:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtUTf8qvlmzdwgauSQ8bO4h7mubtNrPWaMKRN6PTnz7cCB90U0kkzpiQJCjjNwnzqApau0a X-Received: by 2002:a9d:6654:: with SMTP id q20mr4427039otm.180.1584544031941; Wed, 18 Mar 2020 08:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584544031; cv=none; d=google.com; s=arc-20160816; b=YJ+nKLtr4tpl3UdMsGUdpTAi5w4lmroPR6MukmRpj+gJPuSxUVexnxWjFhwn/g/jZF XI70M8DaFEW7po6jFk5QPDtiq8IRWtaJx+dVRcrjhSYrEnsDhuv1pk6QS7ASmQMf4tTR /bN3DFye1BUO2xzqvTX7kfB9Lvg6J8xf6F2WE7CvYoR3SNyGqDK0Y4+qVz/mf5rz8JFG WDnu87p9B628mLp4VbVi2fTgpBLobsPJK5SgyyYEAO0+mDCwts8ah+jxLcjKph9uHSTv 84ly2EWZQYt3j/pcUUYOBgX4i7PAGFGWxeq+Zzjj/WItwGKRy7OwS3S1431Ajf6K6ha/ wgUg== 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 :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=e/8oKaNwBTjhOkAOmc6Y3YdVNmuI5yN2hQOJFhQz4lM=; b=rfSAn95TM0b7qt2uNKghXYONWfcacnGr/m9wTVr/YbotQc7C8PU+XiY27IFNkVfSq+ tcpG/KcGfOc/Vu43qZ1sVVlQXr1eP93IbJi8cBcyyUSpkItSMh0CqRbxPPaVZPqorYkj kZPv0SLr2BYYwEL4YMyt5fVmpGZp9vpoqL7v5uFF0IOFliyD/mMLmYGkoo48+/T96Wk3 CTH17Pp3AYBS03ZO+nhnMk9yb+r9Vm1XyfpiBzIIWPo6qTdFdSwIARujzIb3txUwyB1+ nPdLOaWLnINwDzgeMtl5R2w+7nszq0ChbYOomwif5yKNL5IZ2QzRjcL3LMe9it6TXUzt fnTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dbrHblWu; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si3363026otj.275.2020.03.18.08.06.43; Wed, 18 Mar 2020 08:07:11 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=dbrHblWu; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727201AbgCRPD7 (ORCPT + 99 others); Wed, 18 Mar 2020 11:03:59 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:57896 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbgCRPD6 (ORCPT ); Wed, 18 Mar 2020 11:03:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584543837; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e/8oKaNwBTjhOkAOmc6Y3YdVNmuI5yN2hQOJFhQz4lM=; b=dbrHblWuA5j9HNlrRQv8yRwYzIgQWVu8ziYI4oKiGxKd3vIkKKt3bmRzfMIhrsXU781QP7 eh82eMuZc3uop+OGNGYG16A3oCenOoDbFbgEBnyHbjqDxkUo/WENkRcjbQvxubzObmyOoi LD43iEyOvwh3evnAYoCnKD4jGh9Yvvk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-11-FfNo_gf4O0Wxy5Ttl7H2sQ-1; Wed, 18 Mar 2020 11:03:55 -0400 X-MC-Unique: FfNo_gf4O0Wxy5Ttl7H2sQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A0DEA1366; Wed, 18 Mar 2020 15:03:53 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-113-126.rdu2.redhat.com [10.10.113.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF0415C241; Wed, 18 Mar 2020 15:03:50 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 04/17] pipe: Add O_NOTIFICATION_PIPE [ver #5] From: David Howells To: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk Cc: dhowells@redhat.com, casey@schaufler-ca.com, sds@tycho.nsa.gov, nicolas.dichtel@6wind.com, raven@themaw.net, christian@brauner.io, andres@anarazel.de, jlayton@redhat.com, dray@redhat.com, kzak@redhat.com, keyrings@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 18 Mar 2020 15:03:50 +0000 Message-ID: <158454383029.2863966.1921520389317717899.stgit@warthog.procyon.org.uk> In-Reply-To: <158454378820.2863966.10496767254293183123.stgit@warthog.procyon.org.uk> References: <158454378820.2863966.10496767254293183123.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.21 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add an O_NOTIFICATION_PIPE flag that can be passed to pipe2() to indicate that the pipe being created is going to be used for notifications. This suppresses the use of splice(), vmsplice(), tee() and sendfile() on the pipe as calling iov_iter_revert() on a pipe when a kernel notification message has been inserted into the middle of a multi-buffer splice will be messy. The flag is given the same value as O_EXCL as it seems unlikely that this flag will ever be applicable to pipes and I don't want to use up another O_* bit unnecessarily. An alternative could be to add a pipe3() system call. Signed-off-by: David Howells --- include/uapi/linux/watch_queue.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/watch_queue.h b/include/uapi/linux/watch_queue.h index 5f3d21e8a34b..9df72227f515 100644 --- a/include/uapi/linux/watch_queue.h +++ b/include/uapi/linux/watch_queue.h @@ -3,6 +3,9 @@ #define _UAPI_LINUX_WATCH_QUEUE_H #include +#include + +#define O_NOTIFICATION_PIPE O_EXCL /* Parameter to pipe2() selecting notification pipe */ enum watch_notification_type { WATCH_TYPE_META = 0, /* Special record */