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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84DFCC4345F for ; Tue, 16 Apr 2024 22:48:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F14926B0089; Tue, 16 Apr 2024 18:48:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9D436B009D; Tue, 16 Apr 2024 18:48:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D16066B009E; Tue, 16 Apr 2024 18:48:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AF8DC6B0089 for ; Tue, 16 Apr 2024 18:48:14 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3E6DEC0C91 for ; Tue, 16 Apr 2024 22:48:14 +0000 (UTC) X-FDA: 82016884908.16.5BAA453 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 56B48A0012 for ; Tue, 16 Apr 2024 22:48:12 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HWfjcK5T; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713307692; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=dQOrgp2MD172t9l6XQGW4lrZCkMqV6c2thjTwzveTuc=; b=TJoIkQxJqacSS9hTCxOP/KbfjtXBkYmi1kf3nVAuK5EkJZh8YAnuzNNY5CdW2mAo4lh29F hC8o21vwaSfPV7K/lMT7Oxg1BLCXNfPe8yTUMw0IZVcV00ltrNsiJrubIPNVmJSSzHTfdU q72XaZnwSh5ILlYrYZj3L+EEgTrAZFk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713307692; a=rsa-sha256; cv=none; b=ISnNB2YYmYMbPlKtSMIYPJBLFVT/f6MZFBapSNiJcXZSRFllxr00mMEdGLng5xAW73kHIk 1bkcHyq/g5C7Myvdtr5KRTK9k6/myFHjFOTs5+YCFboeb8lZxPoCX/GMVTPanjFUMh6wg4 imcDxGs9i9epEp2qy3w5ZiM+5g8MVjA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HWfjcK5T; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713307691; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQOrgp2MD172t9l6XQGW4lrZCkMqV6c2thjTwzveTuc=; b=HWfjcK5TqBkg6eEhTpJLXnV/zuMAhEMKWXaj7+RGN/tI6gwgDUq39EnNSBqreiz7jPYawu otIlyL798AuSDiRSv0ZwHpPCR5ZpMW2A/cSqTk1HmbLljPfd/i5MIc37b9eTmCuNQl18fL KNgxjUj6D9KGplfxXpgHdtlHzpZC6DY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-dt0tRQhmPu-rFZtjV6hU-A-1; Tue, 16 Apr 2024 18:48:08 -0400 X-MC-Unique: dt0tRQhmPu-rFZtjV6hU-A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C46DD80A1B9; Tue, 16 Apr 2024 22:48:06 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCEA51BDAA; Tue, 16 Apr 2024 22:48:02 +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: <20240328163424.2781320-1-dhowells@redhat.com> <20240328163424.2781320-4-dhowells@redhat.com> To: Jeff Layton , Steve French Cc: dhowells@redhat.com, Christian Brauner , Gao Xiang , Dominique Martinet , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Shyam Prasad N , Rohith Surabattula Subject: Re: [PATCH 03/26] netfs: Update i_blocks when write committed to pagecache MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2755235.1713307678.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 16 Apr 2024 23:47:58 +0100 Message-ID: <2755236.1713307678@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Stat-Signature: m7whqtswm8pzw4qoar1tir7t8g7xtnzq X-Rspamd-Queue-Id: 56B48A0012 X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713307692-674622 X-HE-Meta: U2FsdGVkX1+E+blG6CTVVLz5pcn4KbNMyzWEMNPEr3T6S0C1kSPUbwu3o1qCTfKGJ9uyPgyqcQEPI+qMF3MzLCytB9MG4PQUkRZmqMsFSxfYGpBW6qT7ftz4svnYpzVfyHqNYNluhMECxIVCf0yyEfudnzF+Lg9cAW/mKzNPcdRAeJgPkPo1Cx61WNQvFagPY2DKmQMy2BY4Tg0nKrlPz6j8TyAGVtzRqquuG9Nmv/+dt1uazWZpPX+Xc/h1UkMlEFR++FuxwlfHYTqREQXF0q81HZ2QGk8yCll2uHXRy3lfc4ptD3Gh6xsmGVaULRa1AAYgWeogppbDnJuxb74bvFV0tPe0KzhgZbnWDPEFxBJXeNtye4BBvPOU0vrA7Cv6Dop4uG4hxZc3g6gEJZpFUy1OqBxJ68knJVqiO+aevhyrObuIh3GzjLQBHp7/BB/DIGkJmjRMv66aDE8yVbrf4jH0IsAE9T+hDKAZQzi3kV07RIuo1G/fk7lUVE+EwFnuUctwm4Sw/wnwGUgq80NplXLt6pZFyQ/G2DlA17b3Wi7+tnFcfC0qeOlAxxetfUch9nWapmT7xzqHeSx0WdMD0bVwHar2X8ekuISqOi+gAtWMQ/6U3bo7m6UkV2LEWzvVH/CNGEb7xUwesqu/a1kTh7BM3VM/q6VpYZ66+cA821tH8mB0k9hXp1uhTdPd+C34oXO13MPKoN/wqVioBxQmB5vqXyRg6cDYjvqBUfiswSy17RsqK+qcw77yF+LXx/FJn1HufMABgp+7bgLgiQ+PX3k8AeTMhh4EHP1Eo+pMiTbg1v6ghNFeWshPmrenzpeKS4er1HpAGGRjo1YChCE8QrwvCFTFfcnwY67Yo/Fe74lPquSIgXBPCgYwCWZZwg9lFM6cefvFXGdrRYjXy6ZoAq1KDarMmBAl46eaxcG2UPLpdMoGU4LK3Du/Hd3Syo3Tryj+Zma5WvCE3ozk4CF R2pN7wzN W7p3zSk4muVBp2SLIpxx5Y1PoFyS8sdmd7avh+Kwu9dkw2ri0giYu6IAlmylpzzYWW3AzsdmHfL/sNb4WZqCT7k855nZaU9wtx+IToPdX6yN3/ML0wjSmiHK03JHSky5pHZtKQZlarnvRXe8XcBDJblAWtxQ9gQfnGjrIhGRJ/lTUSm9SpP6p5lhtNyDQcs3lyMCGuowSMqPYcQHmKKQSSZxbIsJt1APGI8ozs8I84zo2ORPVua2xNTo1ddmG6NGCqqzBs7DfnkblCs77N7aY0drzjLg0WnTGkwPL87ztRp0eIdoBVj6pDCp8Lw74dMjLGzSH+en7EG/lD2rrlEgBKOPvr06TFAms7twf 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: List-Subscribe: List-Unsubscribe: Jeff Layton wrote: > > Update i_blocks when i_size is updated when we finish making a write t= o the > > pagecache to reflect the amount of space we think will be consumed. > > = > = > Umm ok, but why? I get that the i_size and i_blocks would be out of sync > until we get back new attrs from the server, but is that a problem? I'm > mainly curious as to what's paying attention to the i_blocks during this > window. This is taking over from a cifs patch that does the same thing - but in co= de that is removed by my cifs-netfs branch, so I should probably let Steve sp= eak to that, though I think the problem with cifs is that these fields aren't properly updated until the closure occurs and the server is consulted. commit dbfdff402d89854126658376cbcb08363194d3cd Author: Steve French Date: Thu Feb 22 00:26:52 2024 -0600 smb3: update allocation size more accurately on write completion Changes to allocation size are approximated for extending writes of ca= ched files until the server returns the actual value (on SMB3 close or quer= y info for example), but it was setting the estimated value for number of blo= cks to larger than the file size even if the file is likely sparse which breaks various xfstests (e.g. generic/129, 130, 221, 228). = When i_size and i_blocks are updated in write completion do not increa= se allocation size more than what was written (rounded up to 512 bytes). David