Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2857041pxj; Mon, 14 Jun 2021 08:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbSb+LL8MvHLxxIXSTzG14+yYprtCcUGu4TIf/wtxDmEcsqLKgunECuCPYG+vUv0ImMjJF X-Received: by 2002:aa7:c594:: with SMTP id g20mr17281694edq.193.1623685327827; Mon, 14 Jun 2021 08:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623685327; cv=none; d=google.com; s=arc-20160816; b=irkQMm37nYx6rKSkpZtBu3sB1dKLy0C+KAq3HySO3hDZVa7F/hcS3oPm7hVio0Qg7y 4zgNQT5XevctAokWtZlWYFHd8RFGkFyyRIrMYpJwXd5m1gh7T2cCBAd/ko0hD4pIZaEe c892P1UW3bAbvhbuWSmjlefxcKrrJrYP+PCpXS907ltJv2/CBaDJWNsXd0ZSEbW2EBIw D3E06z6dgH7+TTYzVekEHjz5V/B3Oz4UWdmqptl4MOipCAoZxHZe1wig5n0ZwPmKKokX KaqQe4SwkXkFo9WzB+yX+QFl1DLX66GeZrroXnSm5eArbpntcnGQQbhUCa39tMDuFn8x wZLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=qKSz/LRN00+0nJv4NZOhjKiU+MuuvkiLXHI2jFvDWTo=; b=Q66k+AAqeLLRT5KMTOxGz5RQILB3U8+/sAHW52VrU6Zku6wX79LheAGF6IZORNpGkR L1aWhKhXfkKt56cBIs4trlmkvMaOgP0I31yrQdy0XEF/XC3/wOM86C3MMZ4XVrshoX+F 6OCboTT8I5m9m0f+79AQOP3/9foQqyX5/DAW1QSqWeflLaqTiYM2sodDbCID7S6kh1jT uLF49yl+eyttNlUkcAoRaP0pQLbWQm/kh6GIAHLFQ85KMtqafQ8VbWFn8sJmH7NMNXZ/ JCE4D9unWLTizDGCbi9a/cVMr3ggSYJKIpiYkaoQZFj8ssT28cN07mWuquCTJajfD27l hr8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cyMp5Ryk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx16si11105326edb.291.2021.06.14.08.41.45; Mon, 14 Jun 2021 08:42:07 -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=@redhat.com header.s=mimecast20190719 header.b=cyMp5Ryk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233944AbhFNPkg (ORCPT + 99 others); Mon, 14 Jun 2021 11:40:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39565 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbhFNPkd (ORCPT ); Mon, 14 Jun 2021 11:40:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623685110; 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=qKSz/LRN00+0nJv4NZOhjKiU+MuuvkiLXHI2jFvDWTo=; b=cyMp5Rykvxo818HDegBz1uUFprdy7qBaujMADKgU0NscvK7QryAAGEIh52P8rAmINnYSiV AhWii7QmJmE1aZhCJUSb3gItD/pSVTOSvmO+nWyeJdfL8Tc5ce/r2tiD13E4/GUYBU9V3f pFDy2AogffPb/JexZ80DpnvOXIcHcHM= 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-428-7bpBxVSNPlCeR3mvDSJyDA-1; Mon, 14 Jun 2021 11:38:26 -0400 X-MC-Unique: 7bpBxVSNPlCeR3mvDSJyDA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0652619253C6; Mon, 14 Jun 2021 15:38:24 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-118-65.rdu2.redhat.com [10.10.118.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id B766219C46; Mon, 14 Jun 2021 15:38:22 +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: References: <162367681795.460125.11729955608839747375.stgit@warthog.procyon.org.uk> <162367682522.460125.5652091227576721609.stgit@warthog.procyon.org.uk> To: Matthew Wilcox Cc: dhowells@redhat.com, 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <475130.1623685101.1@warthog.procyon.org.uk> Date: Mon, 14 Jun 2021 16:38:21 +0100 Message-ID: <475131.1623685101@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. David