doc:kmsg: explicitly state the return value in case of SEEK_CUR
authorBruno Meneguele <bmeneg@redhat.com>
Fri, 10 Jul 2020 17:44:23 +0000 (14:44 -0300)
committerPetr Mladek <pmladek@suse.com>
Mon, 13 Jul 2020 13:07:45 +0000 (15:07 +0200)
commitbc885f1ab6de0d38c6956a71b0126543b64875b0
treee89b8331b7a6f73655173380e49113952eeec584
parent8eda94bde4ff004a942ed95e6348de711b0e6da9
doc:kmsg: explicitly state the return value in case of SEEK_CUR

The commit 625d3449788f ("Revert "kernel/printk: add kmsg SEEK_CUR
handling"") reverted a change done to the return value in case a SEEK_CUR
operation was performed for kmsg buffer based on the fact that different
userspace apps were handling the new return value (-ESPIPE) in different
ways, breaking them.

At the same time -ESPIPE was the wrong decision because kmsg /does support/
seek() but doesn't follow the "normal" behavior userspace is used to.
Because of that and also considering the time -EINVAL has been used, it was
decided to keep this way to avoid more userspace breakage.

This patch adds an official statement to the kmsg documentation pointing to
the current return value for SEEK_CUR, -EINVAL, thus userspace libraries
and apps can refer to it for a definitive guide on what to expect.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200710174423.10480-1-bmeneg@redhat.com
Documentation/ABI/testing/dev-kmsg
kernel/printk/printk.c