Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1105342lql; Tue, 12 Mar 2024 07:29:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGI/znaIMUSVYajUb4wWvu+uFRqw7kHldTljMCeTPcuCIgqa4zZCCnPUUdPefPfqrrJSM0wLucyZH4BcVCkqKprdzz4rs9Fh3vOTM0GA== X-Google-Smtp-Source: AGHT+IH/DCrQmyN35rr8BxvnFxwzHzjMU/RlP0iES9DuWUjPSNhZ9k0J5oTqzDyYcKwGR+ABJYYs X-Received: by 2002:a17:903:22c8:b0:1dd:72cd:9442 with SMTP id y8-20020a17090322c800b001dd72cd9442mr553082plg.30.1710253752700; Tue, 12 Mar 2024 07:29:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710253752; cv=pass; d=google.com; s=arc-20160816; b=znI2dkAVc7L1Lz7W4GsueDMEf8eJBM2/VPHCM7Z4CdMy7aBwWE/SbLDDKUwSUhlB3A uw2QM45yp4JZFt2vFveQrkKs2B4wBXNFUP4OrMxI+hhxg3kqB1bDy12ifF4Wqh8p7tJi 67I0vpMbkFKwvI5UWKDLxJ05Vt6l74q4XZlFgLknRPxejELR7rTDiVz1KAgGlI9f62am Eiwc9d/xQKb+ATVY51Ri34Dh7g/jHblNGGxtNdtPFrVwYOAbcibbbfMCjWMIr3XMBfOs 7qcxLpM6IzXSZvPgkh8+xcEtkJcpoAKUsoFrteGqTFV1vp9XchnBlHV1NW8zo0p3Q2h3 uBSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kmn1BYFbhsM8azsrnbO9rLxJwlcubYnrbjMKsZaUD/Y=; fh=ZpK2BA/JkmeaJ2rKQyc5Np9nnD5JITGkhkNo7DhWPRU=; b=laMUP85ThNU/ZpzN1NJg5GKagMPSy5A6rhie+RUKSHrxfJ1h4DPsVdAVC+zDfZv34X lSlzEVXhlUvS/sMtYJWnEkDcjWmtg8gPP1PAjWhgVElYWglM5cGTP0GC9uWGgoJWYWql VM80qtGZTjriI5U0FTy3vxxyegJ+O779vjK+PgkrmX/4CEjSLzXiSQvwji9RdoCmWmV/ 6bFr23SpZ0VF8kf2Gcgzf+nQpCuZ87X8VKustiRxbENMsw+cjSIsqfEvNIMZJaZ9xmb1 rN20v4KnNgydEbUxY/WdkT7RdkRoZP/HMWG9uqe4zhrP248Tc0dolf8CgjE3m62Vcjr9 Q0fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=I+IXdD5q; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100256-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y7-20020a17090322c700b001dd9cb02d10si4213908plg.54.2024.03.12.07.29.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=I+IXdD5q; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100256-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 786B8B22F9C for ; Tue, 12 Mar 2024 12:24:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2463B7A14E; Tue, 12 Mar 2024 12:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="I+IXdD5q" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0F1A7A129; Tue, 12 Mar 2024 12:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246243; cv=none; b=U0XBaiY8jsO4iYLmS5Mte0+248O0Z2RQrvcckYgyABRMKodwECYEiCUiy65tpOr5Mxsfs4hyC2o7ZpUr8Z0rdYPgEt4BQuf5b8awLjAnjsgLpTLMp9KdtGapOUa4jfERARUOZxqVAHV5W1AmPF5H/2b9NeY6L/1GD3/T7llZvHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246243; c=relaxed/simple; bh=PBaDVSfhDdJKESyBjRcTtGSxti52ggzrqINVFpc1cLQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F/lz45oImpxe7XGsJXnSBpq773YUeVO2N9NhEmQKh0RxpwHRApzoUW3uGKt9tyr/QDkrPD66xA7ptaE3evEwyhkS13fqx50jU0DgfW8mhdzXz7JG4Qu7mhKvDOabg2ermpr160JtUexQiVBRlP91xHvw98aD5xMiE1tHRgdusF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=I+IXdD5q; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=kmn1BYFbhsM8azsrnbO9rLxJwlcubYnrbjMKsZaUD/Y=; b=I+IXdD5qc9hFmfJqLvXAr2cL7a pTjyx5oTFNuW3hLTVYaCXz8NlgJnzCnlNUoeQc5TgvPyixmoB8uSAjGaSYMBukaQGLyTWaM4frCT1 LySFdt1LNkr0bC7Kf924lNAXQI1XPnOLC1iCfmJG7QYMZFSS9J3C9aIAmPeFQM1ra021AHPUTIvzP ajYMUh0YZ7Jg2IKELiV8Y0RIgOc5lTI4nNrIAeXZbSJBKSMHvHuHlZ/OS5R1jRRN7RB6yuwbQ18H/ kIndrRzQCVM2PjSVakwA9uMz2a7Sr0T7EJEf+91B3K36yNblq01UJpBOOffK7YQacAAU+PVOBsUI9 npFwXgAA==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk1An-00000005jHK-01DP; Tue, 12 Mar 2024 12:24:01 +0000 Date: Tue, 12 Mar 2024 05:24:00 -0700 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Zhang Yi , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH 4/4] iomap: cleanup iomap_write_iter() Message-ID: References: <20240311122255.2637311-1-yi.zhang@huaweicloud.com> <20240311122255.2637311-5-yi.zhang@huaweicloud.com> <20240311160739.GV1927156@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240311160739.GV1927156@frogsfrogsfrogs> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Mar 11, 2024 at 09:07:39AM -0700, Darrick J. Wong wrote: > If at some point iomap_write_end actually starts returning partial write > completions (e.g. you wrote 250 bytes, but for some reason the pagecache > only acknowledges 100 bytes were written) then this code no longer > reverts the iter or truncates posteof pagecache correctly... I don't think it makes sense to return a partial write from iomap_write_end. But to make that clear it really should not return a byte count by a boolean. I've been wanting to make that cleanup for a while, but it would reach all the way into buffer.c.