Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1520663ybt; Thu, 9 Jul 2020 08:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxArL/LtWBQM2lkT+Nle6zXpH4mczX5fUc1AGeTWDgoep+N+NypYKVibii79lMIgE3PpUuN X-Received: by 2002:a17:907:1059:: with SMTP id oy25mr61093485ejb.90.1594310236987; Thu, 09 Jul 2020 08:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594310236; cv=none; d=google.com; s=arc-20160816; b=0ScnPR3c7XueEzvVDHd3LOh/IfAH3ZdmmIN3B0nzeVY6UdtYQ49nnplHZvRuu1wMOW pljcgyPJ6v9KsHsVxA4m1jedVWijsF/PZ2yZ3V10kA5oFBIpABYM4lFqS6Lp6TdRPgWM MDQLuryORBkvgo1H8Mx5va5T+zfWvpVxJw/AxEa+2YPIuzWg1dRurC1EizWQ8y2BkNRe idAsMtHUHtnU6S9h26pBXmUxbKvC7rJAmp27EZhuFnRUQWxPo7qc50hAgKvOOaQqNqr3 fPl22fwY9ebNAisf1a82Ho6V2SQiT7EjxwtvFlheRgTUaWkQeF/mvS3fWaGWJCoFroxJ 7uUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V4dMBJlPQ8H2akrS9eA8GsIyxk9Bt5w1khnbdCVC110=; b=WqmMw7I+Vzx/vkKw3TkM0E5Stea5RodVcqzDKnmoiYfrjuf6Wz7ygKPRlXsk76ZlFz Ev0Ut6oq78EUy674sRMZrhBQXJ5KqWOwqhIrVQeKevPGe5xS5Uw1WPiKKRXJ+ndGBYDF 53utFt4nwMurVqKF8kI/3Q8jgMUb4fNZrbALxKg+i8E5ZdU56CyIcdbVrgnL5uPIU0jG U6opj3N5RKJRiw8BoOxxWA8mzsDW7dHQPnm9iHu60R89V2Ok8EsXHJx2Z//DNm25NjfD Qf7O6OpZs5ZS1GNgVoIjwO2BDux2Tlrc+7TE9yDRSQ/Z0ThKjqQ0gZj1NXUnecylrjOu tx3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YGxW0Cle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm12si2332917edb.333.2020.07.09.08.56.51; Thu, 09 Jul 2020 08:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YGxW0Cle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbgGIPy0 (ORCPT + 99 others); Thu, 9 Jul 2020 11:54:26 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:20645 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgGIPyZ (ORCPT ); Thu, 9 Jul 2020 11:54:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594310064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V4dMBJlPQ8H2akrS9eA8GsIyxk9Bt5w1khnbdCVC110=; b=YGxW0ClekbJQNYEB146dDxZyyyy2Goixd9ug7SZx70XDPJi5PJdIhw1xrJ4+TGrZO+6x2R +C5lAte+MZryAoJhZnDHemMCR12/gO02lyUCVTrRSJ4Ot04Xy6gJCl+lutiAR+YYhjcSw2 /6jE4NKUmM1Bu5mmmdctlcjZ7kvj+6k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-14-ymG3nr9bOkeFYd_TdDJiRw-1; Thu, 09 Jul 2020 11:54:22 -0400 X-MC-Unique: ymG3nr9bOkeFYd_TdDJiRw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 404BF1DE2; Thu, 9 Jul 2020 15:54:21 +0000 (UTC) Received: from localhost (ovpn-116-137.gru2.redhat.com [10.97.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id C93331A913; Thu, 9 Jul 2020 15:54:17 +0000 (UTC) From: Bruno Meneguele To: linux-kernel@vger.kernel.org Cc: pmladek@suse.com, sergey.senozhatsky@gmail.com, torvalds@linux-foundation.org, Jason@zx2c4.com, Bruno Meneguele Subject: [PATCH] doc:kmsg: explictly state the return value in case of SEEK_CUR Date: Thu, 9 Jul 2020 12:54:15 -0300 Message-Id: <20200709155415.41207-1-bmeneg@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 expected. Signed-off-by: Bruno Meneguele --- Documentation/ABI/testing/dev-kmsg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/ABI/testing/dev-kmsg b/Documentation/ABI/testing/dev-kmsg index f307506eb54c..9bc854faaa79 100644 --- a/Documentation/ABI/testing/dev-kmsg +++ b/Documentation/ABI/testing/dev-kmsg @@ -56,6 +56,11 @@ Description: The /dev/kmsg character device node provides userspace access seek after the last record available at the time the last SYSLOG_ACTION_CLEAR was issued. + Considering that the seek operation is supported but has + special meaning to the device, any attempt to seek specific + positions on the buffer (i.e. using SEEK_CUR) results in an + -EINVAL error returned to userspace. + The output format consists of a prefix carrying the syslog prefix including priority and facility, the 64 bit message sequence number and the monotonic timestamp in microseconds, -- 2.26.2