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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AA4CC433DB for ; Tue, 16 Feb 2021 11:55:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A8B8A64DDA for ; Tue, 16 Feb 2021 11:55:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8B8A64DDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 110AF8D0174; Tue, 16 Feb 2021 06:55:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0991B8D0140; Tue, 16 Feb 2021 06:55:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA3638D0174; Tue, 16 Feb 2021 06:55:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id CFD558D0140 for ; Tue, 16 Feb 2021 06:55:49 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 942DA8248047 for ; Tue, 16 Feb 2021 11:55:49 +0000 (UTC) X-FDA: 77823976818.21.drop49_430c53a27643 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 7B280180458CD for ; Tue, 16 Feb 2021 11:55:49 +0000 (UTC) X-HE-Tag: drop49_430c53a27643 X-Filterd-Recvd-Size: 3926 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Tue, 16 Feb 2021 11:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613476548; 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: in-reply-to:in-reply-to:references:references; bh=3PmMMoMDLKUpdyWA+t3gfR/qM+zxf83cCXtDD4CspmY=; b=AEORSeucQbCUNGLrR9M9fiIDvpjiHpM8JTELatLkdYqR9ZvVzQ0lCA2soIhqYJxNAVOOFQ ZYCsDDx649Z51Jiz861wfSbqlEM2sqlnU706cicxoBF7kaymZdpmAlmVP7oyXmw0CVqpXv pLAnsJbeyzKKf9cSVnzJpgigu8vYTiY= 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-353-fzPbbtGgPwedki1-150nhQ-1; Tue, 16 Feb 2021 06:55:44 -0500 X-MC-Unique: fzPbbtGgPwedki1-150nhQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75567801965; Tue, 16 Feb 2021 11:55:42 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-68.rdu2.redhat.com [10.10.119.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1466410016FA; Tue, 16 Feb 2021 11:55:35 +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 From: David Howells In-Reply-To: <20210216102614.GA27555@lst.de> References: <20210216102614.GA27555@lst.de> <161340385320.1303470.2392622971006879777.stgit@warthog.procyon.org.uk> <161340390150.1303470.509630287091953754.stgit@warthog.procyon.org.uk> To: Christoph Hellwig Cc: dhowells@redhat.com, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Alexander Viro , Matthew Wilcox , linux-mm@kvack.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Jeff Layton , David Wysochanski , linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/33] vfs: Export rw_verify_area() for use by cachefiles MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1429649.1613476535.1@warthog.procyon.org.uk> Date: Tue, 16 Feb 2021 11:55:35 +0000 Message-ID: <1429650.1613476535@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Christoph Hellwig wrote: > > Export rw_verify_area() for so that cachefiles can use it before issuing > > call_read_iter() and call_write_iter() to effect async DIO operations > > against the cache. This is analogous to aio_read() and aio_write(). > > I don't think this is the right thing to do. Instead of calling > into ->read_iter / ->write_iter directly this should be using helpers. > > What prevents you from using vfs_iocb_iter_read and > vfs_iocb_iter_write which seem the right level of abstraction for this? I don't think they existed when I wrote this code. Should aio use that too, btw? I modelled my code on aio_read() and aio_write(). But I can certainly switch to using vfs_iocb_iter_read/write, though the trivial checks are redundant. The fsnotify call, I guess I'm missing though (and is that missing in aio_read/write() also?). David