From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F76DC43334 for ; Wed, 1 Jun 2022 19:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbiFATsZ (ORCPT ); Wed, 1 Jun 2022 15:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiFATsQ (ORCPT ); Wed, 1 Jun 2022 15:48:16 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E05F11CA17; Wed, 1 Jun 2022 12:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4Ozc3WmHm81wghcNONugG5hk9vFuG2z5HhSD0Snaras=; b=i+++ReQnDqzP0P6p8kS4NN2U7O ojdpFSmBOMPcjzwyy2Q3sniEbBJQOupIthIpOhs4EWUAdBdzhgj5kwCbSnp8dZUuO+NDQDrSaDLIK AeGjtgP+9RXIl5ERC7FiHris096j7auGtitS7vSZxp1EQIiJmHYdPyQ0gBla8DcHt2Yh2XHJvvkRV EfawBfVZV6nhbOgvVPRevzk596tgaHebq9zlysJ1jzSqwp6MBJFcqU+giDMT8J4XZJaH7Tr9QzW7U 6O/yH44QGbNDIFLpEjDSu8o89ELFU7Eb8ffiTx6/9erZq8ZNmjVfa4ymjf2niy3dFZnfJYS911QPN HWIyFqwg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwTy4-006Y6S-Te; Wed, 01 Jun 2022 19:25:20 +0000 Date: Wed, 1 Jun 2022 20:25:20 +0100 From: Matthew Wilcox To: Linus Torvalds Cc: Alexey Gladkov , LKML , "Eric W . Biederman" , Andrew Morton , Christian Brauner , Iurii Zaikin , Kees Cook , Linux Containers , linux-fsdevel , Luis Chamberlain , Vasily Averin Subject: Re: [RFC PATCH 1/4] sysctl: API extension for handling sysctl Message-ID: References: <5ec6759ab3b617f9c12449a9606b6f0b5a7582d0.1654086665.git.legion@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 01, 2022 at 12:23:06PM -0700, Linus Torvalds wrote: > On Wed, Jun 1, 2022 at 12:19 PM Matthew Wilcox wrote: > > > > Why not pass the iocb in ->read and ->write? We're still regretting not > > doing that with file_operations. > > No, all the actual "io" is done by the caller. > > There is no way in hell I want the sysctl callbacks to actually > possibly do user space accesses etc. > > They get a kernel buffer that has already been set up. There is no > iocb or iovec left for them. I wasn't suggesting the iovec. Just the iocb, instead of passing in the ki_filp and the ki_pos. > (That also means that they can take whatever locks they need, > including spinlocks, because there's not going to be any random user > accesses or complex pipe buffer lookups or whatever). > > Linus