fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms
Date: Wed, 15 Jan 2020 21:11:07 -0800	[thread overview]
Message-ID: <157915146694.2374854.4708773619544238610.stgit@magnolia> (raw)
In-Reply-To: <157915143549.2374854.7759901526137960493.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

The 32-bit calculation of the maximum filesize is incorrect.  Replace it
with the formula that the kernel has used since commit 0cc3b0ec23ce
("Clarify (and fix) MAX_LFS_FILESIZE macros").  This fixes a regression
in generic/351 on 32-bit kernels.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/rc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


diff --git a/common/rc b/common/rc
index eeac1355..cf6bc9d5 100644
--- a/common/rc
+++ b/common/rc
@@ -3999,7 +3999,9 @@ _get_max_lfs_filesize()
 {
 	case "$(getconf LONG_BIT)" in
 	"32")
-		echo $(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
+		local ulong_max=$(getconf ULONG_MAX)
+		local page_size=$(getconf PAGE_SIZE)
+		echo $(( ulong_max * page_size ))
 		;;
 	"64")
 		echo 9223372036854775807


  parent reply	other threads:[~2020-01-16  5:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  5:10 [PATCH 0/7] fstests: random fixes Darrick J. Wong
2020-01-16  5:10 ` [PATCH 1/7] xfs/449: filter out "Discarding..." from output Darrick J. Wong
2020-01-16  9:23   ` Christoph Hellwig
2020-01-16  5:10 ` [PATCH 2/7] xfs/122: add disk dquot structure to the list Darrick J. Wong
2020-01-16  9:23   ` Christoph Hellwig
2020-01-16  5:10 ` [PATCH 3/7] xfs/507: skip if we can't create a large sparse file for testing Darrick J. Wong
2020-01-16  9:24   ` Christoph Hellwig
2020-01-16  5:11 ` [PATCH 4/7] xfs/279: skip test if we can't allocate scsi_debug device Darrick J. Wong
2020-01-16  9:24   ` Christoph Hellwig
2020-01-16  5:11 ` Darrick J. Wong [this message]
2020-01-16  9:25   ` [PATCH 5/7] rc: fix _get_max_lfs_filesize on 32-bit platforms Christoph Hellwig
2020-01-16  5:11 ` [PATCH 6/7] generic/108: skip test if we can't initialize scsi_debug Darrick J. Wong
2020-01-16  9:25   ` Christoph Hellwig
2020-01-16  5:11 ` [PATCH 7/7] xfs/020: call _notrun if we can't create a 60t sparse image Darrick J. Wong
2020-01-16  9:25   ` Christoph Hellwig
2020-02-02 19:54   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157915146694.2374854.4708773619544238610.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).