]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd79853fbd343e4e0e8b8257c22a2ad4d4f869c9e
treee89b8331b7a6f73655173380e49113952eeec584
parent3ea65ec39357c5b51a9a09819f58d92ae9701ab2
doc:kmsg: explicitly state the return value in case of SEEK_CUR

The commit 322bca195362 ("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