From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH 24/32] vfs: syscall: Add fsopen() to prepare for superblock creation [ver #9] Date: Tue, 10 Jul 2018 18:05:49 -0700 Message-ID: References: <153126248868.14533.9751473662727327569.stgit@warthog.procyon.org.uk> <153126264966.14533.3388004240803696769.stgit@warthog.procyon.org.uk> <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: David Howells , Al Viro , Linux API , linux-fsdevel , Linux Kernel Mailing List , Jann Horn List-Id: linux-api@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