Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2859584pxj; Mon, 14 Jun 2021 08:45:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKrfiRrwhXivDqyJxNRNbG2r6XW9JW5zx0Keje2T/g5D5JLfseJX5T+UmPIytv7Sxf4ndR X-Received: by 2002:a17:906:744:: with SMTP id z4mr16089219ejb.347.1623685547810; Mon, 14 Jun 2021 08:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623685547; cv=none; d=google.com; s=arc-20160816; b=KCvNwy5ig6UV+0YcEUomPWkp5wtCqAbiVQ6RrKu4sUBnjbiyY0j3caQgpnB0X9mRXg jrLcjgE6rO1hlIdu1q3aiL2ZXCw2ILhbrIxRkl5K1CoBYW0bdY9Zc78c63PC/FQ5Be3u l7NZ2VjkH37iSXOf10Q63UWxKVIBGOt0j58q14xxIykQ7Cy0JB2hU0aEIaU9Tf7/nQRJ bl7GS9gE2h++lRBm/d1r9N+XhOow2NL18hBfr8uXNY0acCCX/3wXqSHJIW8g/q8xFKSO IP2i12am4cjNgG3hnWA+habLR2z7PJqyAmhPZ9KiBkNn/IvzFMZXM/4W/jXy/data19o R4nA== 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=k+GlvjVi0BRrHEyiA/n5n3EFf4shy2W6VnVssDLXioA=; b=jDAlX0QWiLcpo6CGVHO83hjd2pFYLNu64YM9eE3BY2+pOcExMgLdjngJNVmk3CYcJR AKo/yVUyzSSCR44U2qt7Tkkx0NZcb0zmcPOV1CB19kT7z97EwCW4bdP9rw5jO6VE7o0+ ENm7iSBNHnA0pI/+SQvm6CVG1XO/wUdYZza2ek6hp9EU6SJmeLZBv/6mmWfdCXhpUKis 8dzbR04xweMTt+ihTjW9QqvBJU9MGc5CkxLVAlghgVkJENvIJqDwyfm4f5vnfZz40aTo a6Hi9JwuYuY8LFFJSjTk6KWAbyWaG2bJO2T96ysGIavHCRsgLcpoWZFNt9Yklmr1x6B3 JxBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=s6ODF9Ot; 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 b15si236953edz.434.2021.06.14.08.45.25; Mon, 14 Jun 2021 08:45:47 -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=s6ODF9Ot; 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 S233871AbhFNPpf (ORCPT + 99 others); Mon, 14 Jun 2021 11:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233392AbhFNPpe (ORCPT ); Mon, 14 Jun 2021 11:45:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945E8C061574; Mon, 14 Jun 2021 08:43:31 -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=k+GlvjVi0BRrHEyiA/n5n3EFf4shy2W6VnVssDLXioA=; b=s6ODF9OtR3BlZ9XVnzGicasAeY jlfVoPRVG14lRRMJYIoCdqvGejj20VXBRmKTPwEPzxS4L4lLLzJJfPpHIS69xpFRtsXdnFZvcUmmf VIJHAi4f8Hj7w0SuXn1gGvkVRR6xhFjuvsDcWD9rCyGSjaK/KQg5HEAV6KlA+eAZQZQDeoA/7+fWC VB0I/BoJI1/kpsMFd25OBHVJ5DnorcIYTBZ9LfkHgPretBNDi1v4YLVLU2aFnn7BCyDM5iKNzP0P2 kl4bcdjc/BG7rhdGOb33aNMn14/BFV0hwb+MjSEolasxnORciQAD8kzEE2tlW1Zd/z8bpaLY0/iqM 57ayFTqg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lsoju-005Zja-3U; Mon, 14 Jun 2021 15:43:07 +0000 Date: Mon, 14 Jun 2021 16:43:02 +0100 From: Matthew Wilcox To: David Howells Cc: 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> <475131.1623685101@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <475131.1623685101@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 14, 2021 at 04:38:21PM +0100, David Howells wrote: > Matthew Wilcox wrote: > > > > - ASSERT(PageUptodate(page)); > > > - > > > if (PagePrivate(page)) { > > > priv = page_private(page); > > > f = afs_page_dirty_from(page, priv); > > > > Why are you removing this assertion? Does AFS now support dirty, > > partially-uptodate pages? If so, a subsequent read() to that > > page is going to need to be careful to only read the parts of the page > > from the server that haven't been written ... > > Because the previous hunk in the patch: > > + if (!PageUptodate(page)) { > + if (copied < len) { > + copied = 0; > + goto out; > + } > + > + SetPageUptodate(page); > + } > > means you can't get there unless PageUptodate() is true by that point. Isn't the point of an assertion to check that this is true?