xfs
[Top] [All Lists]

Re: [PATCH] xfs: fix s_max_bytes to MAX_LFS_FILESIZE if needed

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH] xfs: fix s_max_bytes to MAX_LFS_FILESIZE if needed
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Fri, 12 Apr 2013 11:20:30 -0400
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9wGcU6OEnXxbE9SdjvzIW4dGnY6Zl4FoXPptkKSRkFM=; b=OJXkNZ/+nH6jKlxEp0CC+twKUDlEqzXmsAJY0kX1FOvNS57QhTK2fG/k7sOm7kTmQh LMTUyhGXuI48LvznjNhTo+t11nyf4CmsgV44nBYMXbYBCPiQrFquz9DoCFMJikSYoQjf uddnUQnOjiVR76ZkSgYSAZJ5FEVV24TpTX/GA2+JTOfcKGHeQU+iqOfhlKzyrYILvX1n WPylLvNTLqdoo6JVOsREmUDqfgXugZhAOp7DAQEXmGPEAwy36zVuLm8v3QXv62P/zWGY kFh/rEghPMIL8VRzFDw+voAYNUbi4IWzRqJ4cWL07b1qgGLW/sqm0yOd2PCPSDIAMJVc wiaw==
In-reply-to: <5167E160.3020800@xxxxxxxxxx>
References: <5167E160.3020800@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
I'll try this patch tonight.  Thanks!

BTW, after failures with CONFIG_LBDAF=n in previous xfstests, my kernels should have CONFIG_LBDAF=y, but I could be wrong. I'll check this when I get back to my test PC and test your patch with both settings.

Michael

On 04/12/2013 06:26 AM, Jeff Liu wrote:
From: Jie Liu <jeff.liu@xxxxxxxxxx>

This patch fix the s_max_bytes to MAX_LFS_FILESIZE if the pre-calculated value 
is greater
than it.

Reported-by: Michael L. Semon <mlsemon35@xxxxxxxxx>
Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>

---
  fs/xfs/xfs_super.c |    6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index ea341ce..0644d61 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -585,6 +585,7 @@ xfs_max_file_offset(
  {
        unsigned int            pagefactor = 1;
        unsigned int            bitshift = BITS_PER_LONG - 1;
+       __uint64_t              offset;

        /* Figure out maximum filesize, on Linux this can depend on
         * the filesystem blocksize (on 32 bit platforms).
@@ -610,7 +611,10 @@ xfs_max_file_offset(
  # endif
  #endif

-       return (((__uint64_t)pagefactor) << bitshift) - 1;
+       offset = (((__uint64_t)pagefactor) << bitshift) - 1;
+
+       /* Check against VM & VFS exposed limits */
+       return (offset > MAX_LFS_FILESIZE) ? MAX_LFS_FILESIZE : offset;
  }

  xfs_agnumber_t


<Prev in Thread] Current Thread [Next in Thread>