Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2398621rbb; Tue, 27 Feb 2024 23:52:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5uk7f4eiPVWpV3YsEVlJHTO/jmPVWAd++MkDKyclvctT9P1lVWJ1Ewrsj1d6v51uwP/u85VgrhdnZqnXLwHmFTiD1LER/edHuUvOlIA== X-Google-Smtp-Source: AGHT+IGY2AnSsWZaj3MVP8+KNPT1DEgKaC/bKj8ekmRyCjo948DUFzSrN6NxzMqZz8nX8tFOJXRp X-Received: by 2002:aa7:c697:0:b0:563:eca6:733c with SMTP id n23-20020aa7c697000000b00563eca6733cmr8183822edq.15.1709106748893; Tue, 27 Feb 2024 23:52:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709106748; cv=pass; d=google.com; s=arc-20160816; b=0/doSkk8fVMPCLzlNlbpLtExDpa8OHbegBj6BUXxZj+0RcELNW28K7fCRjwwCUT+f7 R4iwc6GbTZGIlPmAkSGe7r/TvSqf97rCuhQ/PzpNH0Q1iBRFuGvrIIRiRSLX5IqF/ZXv vbjB98gdu8EY7Xr8IQT2NbZyHrM+Te5NEUSnCMWFfUFJlLuC0q3ypJojolEvyB8Qv/JF Q0QZr4G1mfpax8bRnLN0CVenhjT6EGNL9xHJjQjWCRflBFOXSq3dW4pKgSoFWCpm7EKi XV0kq95dNjQd8KS850+gHMsyrvUwI9+1QRk4ehafg17qTcYPOTB6SKFkit/jYLwWGXVo E+Rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Zh8crSzzd1QnmeV1OcknR37ATkgZhCAIPO7aiRL4a8s=; fh=skYk5QWABDISft9l5tRhkJAFHyDZNfdqHt9DMcLogC0=; b=UeuXAccoMxNm5pZdvC7FU+KI6evwVfapce7LqH8xGrwZBnIp7os0FvxfGxGIgKNclZ 8ruFKV0Ju9bsyPuiYIolR/dt8rMITjpTDWJ0ZIBH3ngXKHTwHbvmiM1OKHXOWQbsp9Hi G1k55SbsVKOzYNrlz3GVq+4Pv9m01VNh3HsN3WQTD83Q++J7b1HRg8XfwYxhIN3BldVF jvpuzYQ26yaN5cNhGr99x7ujAOXZ/vyyd1i1Ogz1x+cUzNT9KcSfj2xvOeLHdH0/nbqz nHxLHf8A7LhV/Ir2Rex8sZHFAGlNB3MybeE7mxPLSGyceasz4R4IkysZ28bCau/vX+zg anlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=X9VroBu+; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-81107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81107-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cx3-20020a05640222a300b00565fffb0d7asi1468101edb.137.2024.02.27.23.52.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:52:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=X9VroBu+; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-81107-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81107-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E89F21F2A4D9 for ; Mon, 26 Feb 2024 10:14:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 917CC71731; Mon, 26 Feb 2024 09:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="X9VroBu+" Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (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 52E1D6F071; Mon, 26 Feb 2024 09:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708941034; cv=none; b=EjlDZjCEl9NtHR79vSHwMU85cSRYAyO8uTgbkdR7TbwU/pCqN6H8p1o9WWlSm3qZSL+1nkaBb1m9GDrzCjyi2JHLfF0iKogdpAQoHPUwEbRXggOwl9TDAB2nV1TCKF/QeO1LxmAs1EOZYK/sI+uBmt+gOmtYCqGl/TjGOKxbx0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708941034; c=relaxed/simple; bh=RKzUrbiIAwV//xUeCFeu109a33mJKvzhblm+B+JiUEw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mdZ7f9ba5FgZNBc6kwd0PZYI9CD0gyCLWNEDgQVNiYAbn8oPZi7dsTlRh/J99bwv2Nw7QKfyJt8Gs8LAbbqx0AkScHqgqA8CoIy9pMBfejNBf8Vo7M53OFhBOLGAMlUFaMPBjdUzmoPpRXKmaoLsZA60fBshlBPnslBKahAutzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=X9VroBu+; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 -- 2.43.0