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 D5ABFC5320E for ; Mon, 19 Aug 2024 11:59:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E6C96B008A; Mon, 19 Aug 2024 07:59:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6969E6B008C; Mon, 19 Aug 2024 07:59:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55E566B0092; Mon, 19 Aug 2024 07:59:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 362496B008A for ; Mon, 19 Aug 2024 07:59:53 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C515F12128E for ; Mon, 19 Aug 2024 11:59:52 +0000 (UTC) X-FDA: 82468851024.06.B01E276 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id DAA9E180011 for ; Mon, 19 Aug 2024 11:59:50 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fcIdoSFc; spf=pass (imf24.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=1724068775; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id: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=nSDk9RrUaqqTiS3gE8YAv0OqBuyGmh41yRuUpfpoLP4=; b=tUsbO/xyKryDP5PGu2uaPVeTR7mAVA9xRhClvqRVHjYqoqhdP7F865PCln6wWYgUF2BP36 rUPuNPzElHDXEUALVZFdb6dk3ZSDEIOpxwltdUkeU+Me+cVuwGMex1xoNKI/ad9vr38YSH T0T9uC0aAg+USVncQ0IHOOJvoQJFXC4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fcIdoSFc; spf=pass (imf24.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724068775; a=rsa-sha256; cv=none; b=X79745LX+TP60hUjc7cYVO427D+pVBQimguH/skxIb8eygQ3DiI8wvAQg2arZxHTNVRkNE c0wC/mGOJob3+T6Vms72bdXalkrgXKVBSO0E9JuFrVXwAcFESMiVY8/ZW35Y7YBmUQXqp6 GqVW6wA+aajMPsRW0HPbK0FQkcK7Q6U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724068790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: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=nSDk9RrUaqqTiS3gE8YAv0OqBuyGmh41yRuUpfpoLP4=; b=fcIdoSFcs5Je/WCbx4Cd0nSI4raS0XCY8LIrHF31HvNoRE7APrAq9Wd/LHbzB9A+l/AbSs 0vmVXYmyK077RxdFPg9GP/HXJihasEquVAnESo2K1gfrAkaT4nwMR1TFb+r54z2UPRwH0h ig0zBdZGA6sT6Mi03OrCcRZdkZCtJdc= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-y-oQF2GQOyaLK-9XZ_4nzw-1; Mon, 19 Aug 2024 07:59:43 -0400 X-MC-Unique: y-oQF2GQOyaLK-9XZ_4nzw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8403F1954B1D; Mon, 19 Aug 2024 11:59:40 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.30]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AEB1619773E0; Mon, 19 Aug 2024 11:59:33 +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: <3402933.1724068015@warthog.procyon.org.uk> References: <3402933.1724068015@warthog.procyon.org.uk> <20240818165124.7jrop5sgtv5pjd3g@quentin> <20240815090849.972355-1-kernel@pankajraghav.com> <2924797.1723836663@warthog.procyon.org.uk> Cc: dhowells@redhat.com, "Pankaj Raghav (Samsung)" , brauner@kernel.org, akpm@linux-foundation.org, chandan.babu@oracle.com, linux-fsdevel@vger.kernel.org, djwong@kernel.org, hare@suse.de, gost.dev@samsung.com, linux-xfs@vger.kernel.org, hch@lst.de, david@fromorbit.com, Zi Yan , yang@os.amperecomputing.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, john.g.garry@oracle.com, cl@os.amperecomputing.com, p.raghav@samsung.com, mcgrof@kernel.org, ryan.roberts@arm.com Subject: Re: [PATCH v12 00/10] enable bs > ps in XFS MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3405742.1724068772.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Aug 2024 12:59:32 +0100 Message-ID: <3405743.1724068772@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspam-User: X-Stat-Signature: 7nkm8kqzdsmoyxcqwbywz7u97dh43h3r X-Rspamd-Queue-Id: DAA9E180011 X-Rspamd-Server: rspam11 X-HE-Tag: 1724068790-836472 X-HE-Meta: U2FsdGVkX1/iBceCmWSZVEos5qEyJMhhRuAsla/kI7xXtx/FyosGDakb3n9xMKRpXeEGLWiiaYrWPKa1ADWtWBCecZV2zqmJ2FhKSfYb8+pJSMh5ywUMgzbY8P3j18JR/wAy8FmkIbXqFMflyDgwF8TDtQSz3BgGH4sZZlB703vOF20iPxcC2VFqzgt0kd39FBQ7x0DcAU3BhXYfJugLYMtIjPRVciR+fmRN0EeSS3QPOyFG0zX5dswx2N5JvTtGWvtLR8eNNUHDv6L+72OAmUgJ6jql2mLxTLKZBwvwrfylEylVFJwRTEp6uM7dqCPZmRlw00yNRvPwm6bxehb946kpOmYnhfl0NKdkgL90HF5YTTAeQgUPVUlpRe4MGPuJGS7+k4mNMDIc7Hrku3dNetUX5nKtvcNIjejkGn5IdaxZ6oK0MewH0vUJLtD5EG3OXjdI8Lw6YB5LTz/hbKXQRBXvEWocCE+mot9waWmD/RvPh3/r0Zd/U0d2otjN0evQwxkYSBPVubYZLXoiaB3fOapeCV95Uo2FRJN/Rz9SiEqMxJhpaN3d7eKRQcVnaRmwAz8TunjQh2Ia5+MeKfv5EDiAkah4YbQQL3JBEmfPSAuMbtJ7zKCvHMCILXT4YPcDnGlT45hAz0vdjlxtmlgmeSdwCm5VgNGICro5ilsOR/t2uxeKn72NLqvNKeJFF189ClZsStCXHv8F2wz7OsZbEq2NeLmRHtNf8ZQO1pk8/wD1DcW+YzuBLDC6gfzIkewR4ozU1HxszEiShG1+NHPsZ0wl9+oFrEcIaFZV32pY+mydM4+F0+eWgVIo3MW+ZC7eUIcn5cVgAd3n5YNg2J6Q8Q2+FGpANFLtGfyI2qSXAU1BDqsuKP6UkeQhssmfG/xCAg6nikSRT3d+lnPOIObMZ8Rm65+iKIB0sgE+JtzTPtfLR5DB4jmt78Oj4p+BGIDnRRZslvbyHoXukJrqF/8 TxnnL+nd FlMeTolc+ei6L229L6sfDjbUlebwvLh7IICBdJ6SN5WufVRwdB1c4LCug9nZf1hILD93AzeL3LXa/yvG/lzhZermBv45Ex7FyHArXXYKKvNKBlsqsLhYeRZX6+/BpkoJn7DLRktF8YNsduWeA0I8EyPd562DB4znnj3D30Qf/eMBR27k072jYB7JunY55lzeQG6wZwOpxfAYqvSp1zeyjmVnpm4H6u//R7F+Mq4+4uTgWITrWdTRuOLZtuYvhf4nuef6sXOpmofQMyC+Z02MARnUhGYFYLCZ5dtwjXWSQSQy3+1gMr3l28uW7K8I0bN0C6kQl78D0oC1npEGfu6Gb8c0yB5i76JroTxU/RjTt9sCQC7I= 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: David Howells wrote: > You can see the invalidate_folio call, with the offset at 0x4 an the len= gth as > 0x1ffc. The data at the beginning of the page is 0x78787878. This look= s > correct. > = > Then second ftruncate() is called to increase the file size to 4096 > (ie. 0x1000): > = > pankaj-5833: netfs_truncate: ni=3D9e isz=3D4 rsz=3D4 zp=3D4 to=3D1000 > pankaj-5833: netfs_inval_folio: pfn=3D116fec i=3D0009e ix=3D00000-00001= o=3D1000 l=3D1000 d=3D78787878 > pankaj-5833: netfs_folio: pfn=3D116fec i=3D0009e ix=3D00000-00001 inval= -part > pankaj-5833: netfs_set_size: ni=3D9e resize-file isz=3D1000 rsz=3D1000 = zp=3D4 > = > And here's the problem: in the invalidate_folio() call, the offset is 0x= 1000 > and the length is 0x1000 (o=3D and l=3D). But that's the wrong half of = the folio! > I'm guessing that the caller thereafter clears the other half of the fol= io - > the bit that should be kept. Actually, I think I'm wrong in my evaluation - I think that's the region t= o be invalidated, not the region to be kept. David