lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240815090849.972355-9-kernel@pankajraghav.com>
Date: Thu, 15 Aug 2024 11:08:47 +0200
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: brauner@...nel.org,
	akpm@...ux-foundation.org
Cc: chandan.babu@...cle.com,
	linux-fsdevel@...r.kernel.org,
	djwong@...nel.org,
	hare@...e.de,
	gost.dev@...sung.com,
	linux-xfs@...r.kernel.org,
	kernel@...kajraghav.com,
	hch@....de,
	david@...morbit.com,
	Zi Yan <ziy@...dia.com>,
	yang@...amperecomputing.com,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	willy@...radead.org,
	john.g.garry@...cle.com,
	cl@...amperecomputing.com,
	p.raghav@...sung.com,
	mcgrof@...nel.org,
	ryan.roberts@....com,
	Dave Chinner <dchinner@...hat.com>
Subject: [PATCH v12 08/10] xfs: expose block size in stat

From: Pankaj Raghav <p.raghav@...sung.com>

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.

This change is based on a patch originally from Dave Chinner.[1]

[1] https://lwn.net/ml/linux-fsdevel/20181107063127.3902-16-david@fromorbit.com/

Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Reviewed-by: Darrick J. Wong <djwong@...nel.org>
Reviewed-by: Dave Chinner <dchinner@...hat.com>
---
 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 a1c4a350a6dbf..2b8dbe8bf1381 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -567,7 +567,7 @@ xfs_stat_blksize(
 			return 1U << mp->m_allocsize_log;
 	}
 
-	return PAGE_SIZE;
+	return max_t(uint32_t, PAGE_SIZE, mp->m_sb.sb_blocksize);
 }
 
 STATIC int
-- 
2.44.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ