[LU-9814] prealloc table change don't work after 2.10 upgrade Created: 01/Aug/17  Updated: 26/Oct/17  Resolved: 24/Oct/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.10.0
Fix Version/s: Lustre 2.11.0, Lustre 2.10.2

Type: Bug Priority: Major
Reporter: Alexey Lyashkov Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: None
Environment:

RHEL 7.2


Issue Links:
Related
is related to LU-3719 divide error in ldiskfs_mb_normalize_... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   
  1. cat /proc/fs/ldiskfs/md0p1/prealloc_table
    256 512 1024
  2. echo "256 512 1024” > /proc/fs/ldiskfs/md0p1/prealloc_table
    -bash: echo: write error: Invalid argument


 Comments   
Comment by James Nunez (Inactive) [ 03/Aug/17 ]

What version of Lustre are you upgrading from?

Comment by Alexey Lyashkov [ 03/Aug/17 ]

It test system upgrade from IEEL 3.
bug introduced by commit
git describe b9ecf2671cba08530cc49d47713a360f2c6c25ca
v2_10_50_0-19-gb9ecf2671c

if one chunk was reverted

--- ldiskfs/mballoc.c	2017-08-01 05:41:12.711164350 -0700
+++ /usr/src/lustre/2.10.0/ldiskfs/mballoc.c	2017-08-01 05:44:25.782155391 -0700
@@ -2357,20 +2357,16 @@
 	num = 0;
 	cur = str;
 	end = str + cnt;
-	while (cur < end) {
-		int rc;
-		while ((cur < end) && (*cur == ' '))
-			cur++;
-		rc = kstrtol(cur, 0, &value);
-		if (rc != 0)
-			return -EINVAL;
-		if (value == 0)
-			break;
-		if (value <= prev)
-			return -EINVAL;
-		prev = value;
-		num++;
-	}
+        while ((cur < end) && (*cur == ' ')) cur++;
+	    value = simple_strtol(cur, &cur, 0);
+               if (value == 0)
+                      break;
+               if (value <= prev)
+                       return -EINVAL;
+               prev = value;
+               num++;
+       }
+
 
 	new_table = kmalloc(num * sizeof(*new_table), GFP_KERNEL);
 	if (new_table == NULL)

it will be work again.

Comment by Peter Jones [ 03/Aug/17 ]

Bobijam

Could you please advise?

Thanks

Peter

Comment by Alexey Lyashkov [ 03/Aug/17 ]

btw. patch in LU-3719 isn't real solution for a own bug. We hit similar bug with patch applied. LU-3917 root cause is unprotected access to the table while update. prealloc_table modified by ext4_mb_prealloc_table_add while accessed. Andriy Skylush should fill a ticket and provide a more details in near time.

Comment by Gerrit Updater [ 15/Aug/17 ]

Yang Sheng (yang.sheng@intel.com) uploaded a new patch: https://review.whamcloud.com/28553
Subject: LU-9814 ldiskfs: restore simple_strtol in prealloc
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: add8915bb4083d29aec27fb81ac49b7ed9ecb9a7

Comment by Peter Jones [ 18/Sep/17 ]

Alexey

Does this patch work from your point of view?

Peter

Comment by Brad Hoagland (Inactive) [ 14/Oct/17 ]

Hi shadow,

Do you have any updates on the patch?

Thanks,

Brad

Comment by Gerrit Updater [ 24/Oct/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28553/
Subject: LU-9814 ldiskfs: restore simple_strtol in prealloc
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 685ef61f0fb9849e3f7a32c4ebf2980d3300afb0

Comment by Peter Jones [ 24/Oct/17 ]

Landed for 2.11

Comment by Gerrit Updater [ 24/Oct/17 ]

Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/29733
Subject: LU-9814 ldiskfs: restore simple_strtol in prealloc
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: d42fb752b4b03e03e88c42bcc45ce324dba2e6a5

Comment by Gerrit Updater [ 26/Oct/17 ]

John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/29733/
Subject: LU-9814 ldiskfs: restore simple_strtol in prealloc
Project: fs/lustre-release
Branch: b2_10
Current Patch Set:
Commit: 3e8f17ccfe0a2358b93dbda9bba05c8dfd95aa61

Generated at Sat Feb 10 02:29:31 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.