vfs-ino.patch 600 Bytes
Newer Older
J. R. Okajima's avatar
J. R. Okajima committed
1
SPDX-License-Identifier: GPL-2.0
J. R. Okajima's avatar
J. R. Okajima committed
2

J. R. Okajima's avatar
J. R. Okajima committed
3
diff --git a/fs/inode.c b/fs/inode.c
J. R. Okajima's avatar
J. R. Okajima committed
4
index 7d57068b6b7a..d78538d2e0c0 100644
J. R. Okajima's avatar
J. R. Okajima committed
5
6
--- a/fs/inode.c
+++ b/fs/inode.c
J. R. Okajima's avatar
J. R. Okajima committed
7
@@ -893,6 +893,8 @@ unsigned int get_next_ino(void)
J. R. Okajima's avatar
J. R. Okajima committed
8
9
10
11
12
13
14
15
 	unsigned int *p = &get_cpu_var(last_ino);
 	unsigned int res = *p;
 
+start:
+
 #ifdef CONFIG_SMP
 	if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
 		static atomic_t shared_last_ino;
J. R. Okajima's avatar
J. R. Okajima committed
16
@@ -905,7 +907,7 @@ unsigned int get_next_ino(void)
J. R. Okajima's avatar
J. R. Okajima committed
17
18
19
20
21
22
23
24
 	res++;
 	/* get_next_ino should not provide a 0 inode number */
 	if (unlikely(!res))
-		res++;
+		goto start;
 	*p = res;
 	put_cpu_var(last_ino);
 	return res;