@@ -63,6 +63,16 @@ link_unlink_storm()
rm -f $seqres.full
nr_cpu=`$here/src/feature -o`
+# max_user_instances limit the number of inotify instances that
+# can be created by per real user ID.
+user_instances=`sysctl -n fs.inotify.max_user_instances`
+
+# Generally already some processes have occupied a few of inotify instances
+# So maybe use user_instances/2 will be safe
+if [ $nr_cpu -ge $((user_instances/2)) ];then
+ nr_cpu=$((user_instances/2))
+fi
+
echo "Silence is golden"
_scratch_mkfs >>$seqres.full 2>&1