[Top] [All Lists]

Re: [PATCH v2 7/8] xfs: Add xfs_log_rlimit.[c|h]

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH v2 7/8] xfs: Add xfs_log_rlimit.[c|h]
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Fri, 17 May 2013 15:31:03 -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=mHola31Hw/CUncc6pjlZzACwYms20E/mr5Gi3GC+30g=; b=XIr1yOEsJrbwmr0LEpuThitQNXZNDRQxoxeBb6nKGEYLop94CWZkMsu+aCvgl1Pf8t 20iw89gdl2Yva/XC1gfxDuDwIcT5RllYd9EsxgDxa0JC2+zqVPDcR7bfKhX0C33IZRlg XfkpRUIs/ieuZS4xWGztPoXr6mCacgwb0tW8SyqNEbpMo2+4KfNE7ldXNx8GPyG0V8AG SPGT45f58rF4RhQMW60ir1DiKVmr4ZBhfmq4WbA/M5tl8lw64B/HiiAqqIrtI9cSwstO OJ+qC9qzNrNBOD5Jjk2rM0/urJlr/EGpgl6fvjejG+B8a9GwAzWcjQ7nPl6/iRy6ULR8 4ddQ==
In-reply-to: <5195FB1B.9000803@xxxxxxxxxx>
References: <5195C279.3060502@xxxxxxxxxx> <5195EC13.2060502@xxxxxxxxx> <5195FB1B.9000803@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
On 05/17/2013 05:40 AM, Jeff Liu wrote:
Hi Michael,

Are you compiling kernel on 32-bit system?

Yes, this is a 32-bit Pentium 4 system.

Looks this issue is regarding 64-bit division at roundup() on 32-bit if so.

Could you please try below fix?

diff --git a/fs/xfs/xfs_log_rlimit.c b/fs/xfs/xfs_log_rlimit.c
index 3e84d46..49a88cc 100644
--- a/fs/xfs/xfs_log_rlimit.c
+++ b/fs/xfs/xfs_log_rlimit.c
@@ -127,7 +127,7 @@ xfs_log_validate_logspace(
          * Also, the log size should be a multiple of the log stripe unit, 
          * it up to lsunit boundary if lsunit is specified.
-       minlblks = lsunit ? (roundup(BTOBB(maxlres), lsunit) + 2 * lsunit) * 2 :
+       minlblks = lsunit ? (roundup((int)BTOBB(maxlres), lsunit) + 2 * lsunit) 
* 2 :
                             BTOBB(maxlres) * 2;

         if (log->l_logBBsize < minlblks) {


This code works, and my sysadmin-hack use of "const" was not needed after all. If you use Dave's suggestion to use roundup_64(), I'll be happy to apply another patch.



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