Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2768723pxj; Mon, 14 Jun 2021 06:49:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyj8Aaf5OrNFJ58ueQx6SaF+R6dDhVg9aR//1blVkt0Xmways6q4znoHQ61JQqI+ZRKe9l X-Received: by 2002:a17:906:49c8:: with SMTP id w8mr15546195ejv.497.1623678539786; Mon, 14 Jun 2021 06:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623678539; cv=none; d=google.com; s=arc-20160816; b=I2NEI0S19w7D5WSTgbkbBNu51XrK6/0spjY2ZCX6pjUBZ/H3f0MVE+uQN5C+SGsN8t 1OT5Ov+ocgH4eDa+j9zqC5kDg0w2AymCEcTMjEpiiMYDZpxQAPRuap68nJXzUEZHe1Zz 64yfdovp0IBs3hDAj0u0+D8ozgMk61NNHqen5LDYDI6n/davwEzF2tAfKO8iiYJ8cyPE K1cFPIgVC0MTLqN0IgHbaLuVPiHvMc2Vj9IHBdsdQxWINVs/5hPncHMcUqxxVtuZa7oL MNBMVKrBPZfY/xL7oUZl59Er/EcvHTTUJn9/kIWboOdletpVb+Ey5WWT21qSTbOGSCKB 9N9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LPqO+dW9BvhRSiVFc/Fk8YBZ3qqyoUl/xcHNa5bqxIA=; b=AKFi/Kf/ct51D+TBqUEhx2mKL6VFVBSujJQRogFGjPZJSZhBHtE5kt3fCcXX72MTSW Wi6DwWEp4/N+WIBSCQziBSicOMl8/4/UkvA+eA5Ka+f0sGOgBTzqUd0MFBZOdalOm5vo Rhuyc2QlSldKuAOKn8k0YtkTxFziOYgnKC6t0VL4epCIucU2Kr7FgaIMivrKECmFQ8KL qoPgAu+tOlKfkyzHWQHgFkD8mIWs5aiTPr5ecMw8d9CyyK24Psms2nPLd2vhGpKBqYYg oYHeAya7/J6fNAor3yNzCtSaxyyZYLWACLDs1JBw4HFbU5zbJKALR83wdlJWITXHEwk8 1GiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ImI6filR; 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 b13si3944284ede.243.2021.06.14.06.48.36; Mon, 14 Jun 2021 06:48:59 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ImI6filR; 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 S234254AbhFNNsl (ORCPT + 99 others); Mon, 14 Jun 2021 09:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233739AbhFNNsj (ORCPT ); Mon, 14 Jun 2021 09:48:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F105C061574; Mon, 14 Jun 2021 06:46:37 -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=LPqO+dW9BvhRSiVFc/Fk8YBZ3qqyoUl/xcHNa5bqxIA=; b=ImI6filROaKDnSBRvSEYetlKZC bUUve2305RRRYwBrlH0tw9ftOWT8FmQUSHf9mf8n5I+s49juLH6ZrQAmlz0K8jCljA4Hg+SmhuL5I cgalD/SPq0FDfOWOdBn02y6GhjHbNcINlb6NzQg8hEcLD3yMktcnozf9e0mbXJLuw6X5C6ym7ihqX zudiyoa5YIiiFKgk+5EHwFm2zmNbzwhD0cuER74D56tNGlF9aqC18EmLY25OBNMdQq9JwVyifr37Q P2KwkvZi2uGU+t5tMmB0rDZfYUsoqDF1o1c85uWoiBytEY4GESkLD3SfWmMAkcA2vec4keH55QaLA +REc/jsg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lsmuh-005TjH-T1; Mon, 14 Jun 2021 13:46:13 +0000 Date: Mon, 14 Jun 2021 14:46:03 +0100 From: Matthew Wilcox To: David Howells Cc: Al Viro , jlayton@kernel.org, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] afs: Fix afs_write_end() to handle short writes Message-ID: References: <162367681795.460125.11729955608839747375.stgit@warthog.procyon.org.uk> <162367682522.460125.5652091227576721609.stgit@warthog.procyon.org.uk> <466590.1623677832@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466590.1623677832@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 14, 2021 at 02:37:12PM +0100, David Howells wrote: > Matthew Wilcox wrote: > > > > (1) If the page is not up to date, then we should just return 0 > > > (ie. indicating a zero-length copy). The loop in > > > generic_perform_write() will go around again, possibly breaking up the > > > iterator into discrete chunks. > > > > Does this actually work? What about the situation where you're reading > > the last page of a file and thus (almost) always reading fewer bytes > > than a PAGE_SIZE? > > Al Viro made such a change for Ceph - and we're writing, not reading. I'd feel better if you said "xfstests doesn't show any new problems" than arguing to authority. I know the operation which triggers this path is a call to write(), but if, say, the file is 32 bytes long, not in cache, and you write bytes 32-63, the client must READ bytes 0-31 from the server, which is less than a full page.