Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6486736ybl; Wed, 15 Jan 2020 05:32:51 -0800 (PST) X-Google-Smtp-Source: APXvYqx8kx7jv1ZCkIvISkmfLv3NJRfTgaFANzCboJzboXWioTxAnj6KiAw0+RF0VYz0pUL6uave X-Received: by 2002:a9d:4f0a:: with SMTP id d10mr2756341otl.85.1579095171223; Wed, 15 Jan 2020 05:32:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579095171; cv=none; d=google.com; s=arc-20160816; b=PsjVAxekXlPqnUd4HQ1g9tdy8cGxZjt80PveC8XjCelOJZ7JPY1zGAygSl3RC/jEbY Jz3tS/isT7iCiOM/YT1VQHDvoR48f0noxhnxzTYA1Ppoa+sJYBnDd8b7gFRAMiBLc8Jc /sSfNY5fUSbAHCDN42MO6ED+joM3+xwQGsaFa9AuTGZrLJLA0tTjOPbVo2905yQOLyaT FFFUIiHRB1luSc0yv5WxclDHD4CgjBl/Ci7Hft9KKSMlxUTCzDqFySR9ek0Cbxe1t/gI xvrSAMMIYsBz1Z0nX0OwDs764xmki0w7i+k4N352IxMMt1MjuIrBtI8zU4OhNP5LnxVZ m7pA== 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=Af2CPIMRZr9v+SCAhhRUETVRHVwCPSz+0UEiRn9RS4cT4gpkHo0zu3v+NxGukDl2RW C4wcXEvHh8VZ6JkPePmdfBRJUKv+FNe5EonBVYT1ltPYpIMe3J5Vgapp+m7v18kvPaqy iadqdGjr9RwHK+eBLdbiOET1pg0aZ80JPmNp9uvSK67Hrmf9TS3P83Ff7T6XooQdLh2t NdUQI4udalDhcJ9VHw1yYfZXn2unzd3djbFClmLMoYqYQxlX0n5cYdzUaVdcCOttpp6A QLpmi/RZnskzd/xLOyaitrp1E2Q0sJTeYQhgU2VLSh2U3UOM/caejzrY/GtwegTrMGLV k57A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eCsTmRRh; 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 n203si9071810oia.112.2020.01.15.05.32.38; Wed, 15 Jan 2020 05:32:51 -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=@redhat.com header.s=mimecast20190719 header.b=eCsTmRRh; 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 S1729149AbgAONbX (ORCPT + 99 others); Wed, 15 Jan 2020 08:31:23 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55398 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729141AbgAONbW (ORCPT ); Wed, 15 Jan 2020 08:31:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579095081; 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=eCsTmRRhjAbYrU7KwCMsLYrK6yS1RQnpdC1g1aKAmJRVdsNipSziEnEdhPLm62gPbVx0WC gHqkeQM+sTFxKSMRl+Cl2UXwEmqBpqn6bplFs8WigFBML3m6f50pUYYqpVwiKKu03lHJSA +YA6spdJFK+pci6FsoMLnwVdD02t2Tc= 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-234-jo5s5qw-Mz69j_9s40wBJQ-1; Wed, 15 Jan 2020 08:31:18 -0500 X-MC-Unique: jo5s5qw-Mz69j_9s40wBJQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3BD751005502; Wed, 15 Jan 2020 13:31:15 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-52.rdu2.redhat.com [10.10.120.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7E291CB; Wed, 15 Jan 2020 13:31:12 +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: [RFC PATCH 04/14] pipe: Add O_NOTIFICATION_PIPE [ver #3] From: David Howells To: torvalds@linux-foundation.org Cc: dhowells@redhat.com, Greg Kroah-Hartman , Casey Schaufler , Stephen Smalley , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , dhowells@redhat.com, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 15 Jan 2020 13:31:11 +0000 Message-ID: <157909507195.20155.11337528682255354415.stgit@warthog.procyon.org.uk> In-Reply-To: <157909503552.20155.3030058841911628518.stgit@warthog.procyon.org.uk> References: <157909503552.20155.3030058841911628518.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version 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.11 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 */