Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1570413pxb; Fri, 27 Aug 2021 11:56:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9RNVOEqiRaApy738D/+FKCrc96v6rHR27Co9hR646lh4Cz+6+1wk2ijhV89DC1apDCcqt X-Received: by 2002:a02:90d0:: with SMTP id c16mr9328467jag.106.1630090598764; Fri, 27 Aug 2021 11:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630090598; cv=none; d=google.com; s=arc-20160816; b=GVsrns8SS8psGAZ8bjc7iLpkzCMVmNWHQ9YfcVaEOK5D2cBFXoqkrn7/veSxLnRjnq N5eFl4wxa/Um+fg2iFDdT7FRGq/zh52121E5dQLaVpTLebTVa9sIPze/b/rHz334MJ1h lBxHGhAS+MT88E3X8y/icVy6ANh76jTJ1e7EYoSwazxQ/k10ajh5wWcYXUGCy0r/GIzY kPvERCvX8bwNRBJnSMHz1qQeA6l71jebrh3+AICk0exeFC7rk2/4ZftRqvRa9Vli/8V1 oMCe47+LVk2CLZuuSnJfLVHlX5Bwi1ST7X9v1VCK32hyzZ6CzcVfj1+smaCPkSTPBmfl 7Kiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=huI1oJVzJ076AwD1s5UYdy1oOAjTD3+V+vyK467wuOI=; b=Jx4eCPuZ44pQUABDNVswOM2S8mdl9pdZRR5GtZIJbO3UeuieRJu/804zw003MflD/O JWwnZ6RAhnhmw1t/hAjC0fpIvGHHWZAk/vO5dA/XZ0pCNGA7tM0+9FfBs6aLf2t4MZVo oXV0pGG1dfw2v+0aq7ngfD3eVM5GyUOfY2ASatL/uk70dO/7AS5jU8TNX44aPwcv8nUB hbXVpmFq1jFZwUlEKZIv8Ytpvn1dhkJASoi+4MxF7Ys3ujfpOlWm5gforvpGGW12QfRd Ha0H5XxaVT05GhE6stnlMYNw00IE1XttfFLFEBtC9ilkAdt9ZZU70axS5O/+vXcMEU9F xtTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si6823426iog.64.2021.08.27.11.56.28; Fri, 27 Aug 2021 11:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbhH0SzP (ORCPT + 99 others); Fri, 27 Aug 2021 14:55:15 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:42392 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbhH0SzP (ORCPT ); Fri, 27 Aug 2021 14:55:15 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJgvL-00GZ2S-FD; Fri, 27 Aug 2021 18:49:55 +0000 Date: Fri, 27 Aug 2021 18:49:55 +0000 From: Al Viro To: Andreas Gruenbacher Cc: Linus Torvalds , Christoph Hellwig , "Darrick J. Wong" , Jan Kara , Matthew Wilcox , cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable Message-ID: References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-6-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210827164926.1726765-6-agruenba@redhat.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 06:49:12PM +0200, Andreas Gruenbacher wrote: > Introduce a new fault_in_iov_iter_writeable helper for safely faulting > in an iterator for writing. Uses get_user_pages() to fault in the pages > without actually writing to them, which would be destructive. > > We'll use fault_in_iov_iter_writeable in gfs2 once we've determined that > the iterator passed to .read_iter isn't in memory. Again, the calling conventions are wrong. Make it success/failure or 0/-EFAULT. And it's inconsistent for iovec and non-iovec cases as it is.