When tail -f has inotify enabled and hits the max_user_watches limit of inotify, the resulting error message is very misleading.
To reproduce:
1) Make sure you will hit the limit if you try another inotify request
sudo sh -c 'echo 10 > /proc/sys/fs/inotify/max_user_watches'
2) Create a file:
touch /tmp/hello
3) Follow it:
tail -f /tmp/hello
Result:
tail: cannot watch `/tmp/hello': No space left on device
Expected result:
tail: cannot watch '/tmp/hello' because inotify reported: No space left on device
It can be verified by using strace tail -f /tmp/hello:
inotify_add_watch(4, "/tmp/hello", IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = -1 ENOSPC (No space left on device)
Binary package hint: coreutils
When tail -f has inotify enabled and hits the max_user_watches limit of inotify, the resulting error message is very misleading.
To reproduce: fs/inotify/ max_user_ watches'
1) Make sure you will hit the limit if you try another inotify request
sudo sh -c 'echo 10 > /proc/sys/
2) Create a file:
touch /tmp/hello
3) Follow it:
tail -f /tmp/hello
Result:
tail: cannot watch `/tmp/hello': No space left on device
Expected result:
tail: cannot watch '/tmp/hello' because inotify reported: No space left on device
It can be verified by using strace tail -f /tmp/hello: add_watch( 4, "/tmp/hello", IN_MODIFY| IN_ATTRIB| IN_DELETE_ SELF|IN_ MOVE_SELF) = -1 ENOSPC (No space left on device)
inotify_