Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2315190imm; Tue, 10 Jul 2018 18:06:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnEFNZl9HNUbqAobeS2rKyKylLQvk1OY4+B4486vxmr7IsYWqVeRXHp52kH1WIdxRufcXG X-Received: by 2002:a65:638a:: with SMTP id h10-v6mr24979540pgv.269.1531271210378; Tue, 10 Jul 2018 18:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531271210; cv=none; d=google.com; s=arc-20160816; b=AZ/B0bgNVYS+0I1e+TGP+HWV1wxzu8Dc8g418GizwX7kFRKoVNLIN4MGiQI5tpGjXT A5N2ReEuPg/PniuJESG+rwCGpYIf9YAODSalDu/VGcxRHEZ+jMg7mcr+O5IYEe7bCgn5 qbrkRZ+vZ0BZBAlTnqnYp8ubISzaI95XPoKVr9zgR8tW4LXIKFGhiSsBZqpL2YzLKohA F+BjzozzKMe5UUN17rqaUlTE9/v5JvNAEvcZ/bI46iTrNLlg6ksoKivXPmW5JzBEG6AN izBcFzxCdQrUSZpDRxhXbHDQ178DnQceIWYxz+oeGIMCtUkPFwGTdM0Mrg61Q/1Czlx/ 6f8A== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=XTSBXqOF7Ya6N8lC6touJNlkC+pe57MZPixyQfyUQEc=; b=Pye5Pnns0owkpDZRddlBOmTevjLeoZ1zHHjXoNIugndv4kjaGMDiF25O5V9x9oOwzr jAM3vWUq0RB1ujmpx3+J6D9YIM+zsIAOftKovOLgYEFG2eSEQnt1OUGniAXzTe+T2bby c97+G3b3AhoTUGMATuji86KM7VksA1cuThvY+3akh2SsHOMOSDfFPNT5BNigFH9qHTcf pUrNJnLmNuZnXl+vhT5y0n4VlgF22ACl3lSU8sDtTq9EkA28QoNh+Ah12njlIjLn4+7L vuLwYBlt0FLGVifO5eefLKhOCBJvlz6y7Bi7Q+qXDdoW/Eo3NDdoVUS0ptODhEMJ5W3Y ecgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=BgLsZ594; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si19026463pfk.116.2018.07.10.18.06.35; Tue, 10 Jul 2018 18:06:50 -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=@linux-foundation.org header.s=google header.b=BgLsZ594; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732355AbeGKBHm (ORCPT + 99 others); Tue, 10 Jul 2018 21:07:42 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:32859 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732292AbeGKBHl (ORCPT ); Tue, 10 Jul 2018 21:07:41 -0400 Received: by mail-io0-f194.google.com with SMTP id z20-v6so22117847iol.0; Tue, 10 Jul 2018 18:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XTSBXqOF7Ya6N8lC6touJNlkC+pe57MZPixyQfyUQEc=; b=BgLsZ594FxAF0Fyh27txTohyGChI5j26f+iVBP5AI0zFazBA4l6R7ZTnpyTVSrLiZb vjSmp55JSOVaYOQGqGElBZSCvilIqOHIGh3qpCq4IzSLynfD22uOI56NH3QbOQxkoJJn sW22AaXa3rbyvN2VFD0ySKBwL1/ngVY5jVGwk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XTSBXqOF7Ya6N8lC6touJNlkC+pe57MZPixyQfyUQEc=; b=SfnYD9+jUpsOix8+p346POgEOepDO4FKgNpcgAPHH2i2/9XDW2Di9jMpCdDjs76Lqv xeKr5OLVRuOTJSOJdOChcU2/fl7fjrnPsvVbxns/qcnQeELrmDdMGa6RscEx6iBI0T0U uiK0aYdYKwtU/HSoeDVc93ITFiNvRfRHX8Tb5NwXrXktB/7gnsdBqY3P9/jEO25MCBfp IUs/8+tGR0tGY/SSKVr8As/fAZO9gF0ElbyLwbCu/aESio8M+x2zn++4Kf8yhxxnrosc /+zmhhRj0ab/4xP2Nwxxrh1hvvVYk0dnfrahA80h4IaRXKJCSzCwNLuF35YOSM8phFzV X0ow== X-Gm-Message-State: APt69E2xGOGVICMsvjPHRKzQ9RXPt31MbQ8kYR9Amh1qB6siw7n1Q29l sksJkt5O/Ba8VIY7EKzqWqt0Qme7L70zcAQHFps= X-Received: by 2002:a6b:1502:: with SMTP id 2-v6mr24134686iov.203.1531271160235; Tue, 10 Jul 2018 18:06:00 -0700 (PDT) MIME-Version: 1.0 References: <153126248868.14533.9751473662727327569.stgit@warthog.procyon.org.uk> <153126264966.14533.3388004240803696769.stgit@warthog.procyon.org.uk> <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> In-Reply-To: <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> From: Linus Torvalds Date: Tue, 10 Jul 2018 18:05:49 -0700 Message-ID: Subject: Re: [PATCH 24/32] vfs: syscall: Add fsopen() to prepare for superblock creation [ver #9] To: Andy Lutomirski Cc: David Howells , Al Viro , Linux API , linux-fsdevel , Linux Kernel Mailing List , Jann Horn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yeah, Andy is right that we should *not* make "write()" have side effects. Use it to queue things by all means, but not "do" things. Not unless there's a very sane security model. On Tue, Jul 10, 2018 at 4:59 PM Andy Lutomirski wrote= : > > I think the right solution is one of: > > (a) Pass a netlink-formatted blob to fsopen() and do the whole thing in o= ne syscall. I don=E2=80=99t mean using netlink sockets =E2=80=94 just the n= lattr format. Or you could use a different format. The part that matters i= s using just one syscall to do the whole thing. Please no. Not another nasty marshalling thing. > (b) Keep the current structure but use a new syscall instead of write(). > > (c) Keep using write() but literally just buffer the data. Then have a ne= w syscall to commit it. In other words, replace =E2=80=9Cx=E2=80=9D with a= syscall and call all the fs_context_operations helpers in that context ins= tead of from write(). But yeah, b-or-c sounds fine. Linus