From patchwork Mon Feb 26 09:49:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13571769 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 846ADC48BF6 for ; Mon, 26 Feb 2024 09:50:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 126EC940025; Mon, 26 Feb 2024 04:50:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AC85940014; Mon, 26 Feb 2024 04:50:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8F9B940025; Mon, 26 Feb 2024 04:50:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D4CD9940014 for ; Mon, 26 Feb 2024 04:50:34 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7F6F68078D for ; Mon, 26 Feb 2024 09:50:34 +0000 (UTC) X-FDA: 81833485188.06.6C79782 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf18.hostedemail.com (Postfix) with ESMTP id CD0F01C000D for ; Mon, 26 Feb 2024 09:50:32 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=X9VroBu+; dmarc=none; spf=pass (imf18.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708941033; 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=Zh8crSzzd1QnmeV1OcknR37ATkgZhCAIPO7aiRL4a8s=; b=lZpdiU79h9s61DBAMMmbhnwM8mf2U6NYlAoJ5L7pR3ZbZJm8wWnN/ymZhm5hQgzPLDCbwC pa2RMu54GW0tQQJQXZDtfoyvV0zsLMjwvbkzrEEOOHRKv12pUo1CDxeOtfEZWqUF/31H9E fgJQXEKRGhZVzN7eBL5m6JuttJL8JsY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=X9VroBu+; dmarc=none; spf=pass (imf18.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708941033; a=rsa-sha256; cv=none; b=n2p4ZKwvdQTtcT22hRy/DAYfPNOsgxSqlyVCw2vJuHUbW3UAOl1fFuza5X/J/faIifL5Wv HAGixCg+X9XASlo4rAJGcj6sWtx7eRenYMp5TNHIu3/MWSjP2q4qtks1qD2jF5ZMAO+6zn Bc1BJpUfeV9knBTVtZ6ZjNE7C4oyCh4= Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4TjwpY6Hqyz9t0C; Mon, 26 Feb 2024 10:50:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1708941029; 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=Zh8crSzzd1QnmeV1OcknR37ATkgZhCAIPO7aiRL4a8s=; b=X9VroBu+3yO5IgXXT944eaTQlnsCiIDYHWBS+LxO8jDzLeA9zPRPzGeQfbvBJBDt8oQVil 9z/Jroy3X9i5rjyglZl5s+1FojOZZK88Y+XGNkbBm8GWNmi28d75LAv2D11kpCozfKUKZs C/RtBKkXLZ42ChZZiXt/0ETwe/ylfB5qbLaywpGRm9QkT1pglMn9HnC2tkNPrKiyxtug7O zL8gNSCtEFROdxvnAcR3uWDZE1AYGHQUtXzOojhM9P4tfYwPQKgeUKqePIHm1/SFUPJKip 94vDoTelo97v9/BKF2OAD9svWm7Ox8jcJAUWYLurePCPkDU98tjP1ggrHhzjSA== From: "Pankaj Raghav (Samsung)" To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, ziy@nvidia.com, hare@suse.de, djwong@kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, willy@infradead.org, Dave Chinner Subject: [PATCH 11/13] xfs: expose block size in stat Date: Mon, 26 Feb 2024 10:49:34 +0100 Message-ID: <20240226094936.2677493-12-kernel@pankajraghav.com> In-Reply-To: <20240226094936.2677493-1-kernel@pankajraghav.com> References: <20240226094936.2677493-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: CD0F01C000D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: uitm1t1a83j65eoebz1a1nqabhfoo943 X-HE-Tag: 1708941032-102604 X-HE-Meta: U2FsdGVkX18lIwjuniYjBhsYK3mWW/0hSRVYJ3dHODT4ZhyoYQgnqOZtLr7fa4TEg7YZb6UkjxaoyRFuuMUwrlC3r8QM1zcU7zWhiXvcr3RYcA0lpfcdjr5WfPBhdiJTHzPUJJZZyJUIPWlSsctHGhvOYjCsL4e0BG4bW+jEuTTRHE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qNL3yqMNc+vbYX0CKaEWfeyy91tle5dLqF/qLKaqwm22ukYOPlWYw2Oc/VL7ybvuOaDy6mAmebKuc02lXMj/aHIkq0U4Y2POgaO7s/ueRru5xBYwIvlaFukNbyRMyt+g== 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: From: Dave Chinner For block size larger than page size, the unit of efficient IO is the block size, not the page size. Leaving stat() to report PAGE_SIZE as the block size causes test programs like fsx to issue illegal ranges for operations that require block size alignment (e.g. fallocate() insert range). Hence update the preferred IO size to reflect the block size in this case. Signed-off-by: Dave Chinner dd2d535e3fb29d ("xfs: cleanup calculating the stat optimal I/O size")] Signed-off-by: Luis Chamberlain --- fs/xfs/xfs_iops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index a0d77f5f512e..1b4edfad464f 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -543,7 +543,7 @@ xfs_stat_blksize( return 1U << mp->m_allocsize_log; } - return PAGE_SIZE; + return max_t(unsigned long, PAGE_SIZE, mp->m_sb.sb_blocksize); } STATIC int