From patchwork Mon Dec 16 20:41:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13910338 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 3B9F7E7717F for ; Mon, 16 Dec 2024 20:43:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFB3E6B00D0; Mon, 16 Dec 2024 15:43:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BAB8B6B00D2; Mon, 16 Dec 2024 15:43:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4C186B00D3; Mon, 16 Dec 2024 15:43:23 -0500 (EST) 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 7FCE36B00D0 for ; Mon, 16 Dec 2024 15:43:23 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 47C931A00EC for ; Mon, 16 Dec 2024 20:43:23 +0000 (UTC) X-FDA: 82901997150.02.671EA78 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 315EDA0010 for ; Mon, 16 Dec 2024 20:43:00 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EFD01Hok; spf=pass (imf25.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1734381781; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HO1trrAUxh6ged928OSrE9rZIbGVfYli8k1F5yQtGbY=; b=e/PUQ7xLhgsNTAndPIoSfyfjm9MgecTDBJDo3ktA45gEVKUFgsMMm8B9pEVGGBIR/WHZVu ZVi4MX1lH5Tbl54TKNBUDUpVVnRo8+PHS0PFLUPbmYKF/KrW8AQffzvgYuAExZcEJERoXX jD8/4KuPOJEdQhgsSbLD+9LCQ/kr+II= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734381781; a=rsa-sha256; cv=none; b=omVC0ihznXF0eSPmjYVAms+MdFGcZU0YSqkJHpclHlFHbR6Hlz6D54Nw9I+PptDxeRhqtL P5vgo3RQpDY1Ni3y2/ZemMi2GsTTTL2tDAeCGBAO8W7bRcArELvAfNM7JVzxlFIJoRP0Le AsNm2etpdH+gnGKReXkL4stoJR7Qaao= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EFD01Hok; spf=pass (imf25.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1734381800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HO1trrAUxh6ged928OSrE9rZIbGVfYli8k1F5yQtGbY=; b=EFD01HokpE/0o/USxzIcN3QgXbgtzCASCbCcVrNfWaGib52D4vJ2bLDCSYAO0XrIG9rtB1 HM/VqECzRjhnwv6/b3ihkXM4C5ImpWxguPFCw7mHMh6Z30oo7/SyRJhscWMcClqqVEcWDi 0En4yMFb5ZwieR93xuDhZAiM9IUjvzA= Received: from mx-prod-mc-01.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-556-BIkIYcVIPqyGpZGyQNMtTQ-1; Mon, 16 Dec 2024 15:43:16 -0500 X-MC-Unique: BIkIYcVIPqyGpZGyQNMtTQ-1 X-Mimecast-MFC-AGG-ID: BIkIYcVIPqyGpZGyQNMtTQ Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4724195609D; Mon, 16 Dec 2024 20:43:12 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.48]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E5B6300F9B5; Mon, 16 Dec 2024 20:43:06 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, 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 Subject: [PATCH v5 13/32] afs: Fix directory format encoding struct Date: Mon, 16 Dec 2024 20:41:03 +0000 Message-ID: <20241216204124.3752367-14-dhowells@redhat.com> In-Reply-To: <20241216204124.3752367-1-dhowells@redhat.com> References: <20241216204124.3752367-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 315EDA0010 X-Stat-Signature: k4rwb9c78jq3z9jcih3pzncpdyczq7uk X-Rspam-User: X-HE-Tag: 1734381780-854462 X-HE-Meta: U2FsdGVkX1+JUtCbgQby+pAsnfBnenUz2TGd1zQTm+Hzls8qBXB9uetgkKQ4nBd3dY0PSEAY8WBnTs5j6ebga+dN6UJF5+XCayFVEFLeIEQ6YcV6SH184y+SK0UO6TjYk6PcHA5LUQGQdHufIgfGOo4dKiIT5Z+cA50aokUNiA0p9bQhiSk8DuzzyNeQCzhwZN2VlBJtjYk0qqz6bU1+fIOTzG59iQptqW/5gZxkFtbxG/FxWSHGaRQAutcKqbykKe4dzvsuHJ/k0nRCu5X2mWwTC5fP7wv+gFRICAGHbEvI2P7ArhVA+nDvtnpphsRAHaDtCxiT2N6KiUxzPMXzZHEm9PJxM+cLbYjqZzBk4Biv78LYq0W58xe6Dktf9PgklbXTVHAClTuAlvmeXoZ4HWHKjYfJMM8jFnHFpt7DWgpEBK6dM6h61jhp7d+z/KuphOfenvbuDHfVGdNg1YJDRvS8Tq2fvDR0vEV+slIg2NLfsL5/fCsxJRf275dGLrS+2yDPCUU2T6KtRwDTq0DVGBr2LFpSIjEQAeIgduMO5nbWUdodu6dUlTNdK9lvl/DNmwAvojBsiTQbvc5MpN0begYj6OkAtUDUnGV6U21bpSOl5eOIdNaRY62v/wgbg7hH0P3JCHyDOmVkSWsHzCHLqQp3aQSNBXgCAIAyY5mRhF7xMUISsbnLBjUjOY4FxkbK5LxO0mY96HasRqkIyHz0OL1V0lTZir8MrHEBIbfZglK4UOLwVpqWtXi0Lko0Y0dcf9CZqS4gUbxw7sttwsnSNdINFbHLiVUKe5p++XvYxVPgDu4XSrGaEKZVQ7auj6W7PPS7rVDhFEl1Wng9W7jsnC3yDBERvOj3TUWe868VS3AAIdVEHr4Rar2rphNUEfrD/+3rIgzv6DLoqWtQ37YW33xLJEUYDC1GYWPI42mHx7hlEBbPSfG7EJEMJ16St9Pyj/rw9SSba+3Ne/03l7b 9Iqh+pFF pyY+0YP9pMdaKJziiLy/rhMfebo8SOL9ASv6T82rxSPn5w62CNTa/W6C/bEg+2+fUPQUFVHXJQ7gHuvpnmAjrC9mPefy0HdjdhD4M5JjiZWRbuxbg8c06wE7H5cyCgmeqBtwGv1LcoYfl3nfvuH9ONeIFDdYkmlm4Yf9XUvfsRo5tzEkCqJGYRcYe+zjNj7HvvoLEqHnxD4OIsFZlT8GfPQ39ZOJrHEJH5RbWAHRKfb4rogLApb+oTOtdTWaBh2uBG4UFtl9Nt4XsSUVbMO0qiXX0Nm9nnpeX7NpxeUD6DzaB0mvCGBot+6Cs9yJsnIA3p6IOj+PW2TDnGjZpeXJPw2nR4bvST+5BZBV5jYxhWEjoxzNWt7kRYoABo7cJDFG+t3Fyb7XADujtBQ8Eq3vBVE76I/4fEYFqA2tmDHrLu4LF+kGPil9lJ6Tk17Lex22qikPL 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: The AFS directory format structure, union afs_xdr_dir_block::meta, has too many alloc counter slots declared and so pushes the hash table along and over the data. This doesn't cause a problem at the moment because I'm currently ignoring the hash table and only using the correct number of alloc_ctrs in the code anyway. In future, however, I should start using the hash table to try and speed up afs_lookup(). Fix this by using the correct constant to declare the counter array. Fixes: 4ea219a839bf ("afs: Split the directory content defs into a header") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/xdr_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/xdr_fs.h b/fs/afs/xdr_fs.h index 8ca868164507..cc5f143d21a3 100644 --- a/fs/afs/xdr_fs.h +++ b/fs/afs/xdr_fs.h @@ -88,7 +88,7 @@ union afs_xdr_dir_block { struct { struct afs_xdr_dir_hdr hdr; - u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS]; + u8 alloc_ctrs[AFS_DIR_BLOCKS_WITH_CTR]; __be16 hashtable[AFS_DIR_HASHTBL_SIZE]; } meta;