summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 0401d2c..648e71c 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -840,7 +840,11 @@ unsigned int get_next_ino(void)
}
#endif
- *p = ++res;
+ res++;
+ /* get_next_ino should not provide a 0 inode number */
+ if (unlikely(!res))
+ res++;
+ *p = res;
put_cpu_var(last_ino);
return res;
}
OpenPOWER on IntegriCloud