Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1329593ybn; Wed, 25 Sep 2019 16:29:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjkEpXhC/SIBMkd0kQLN4zdHIh52a/kIuYDupUPt21YZZgB2y7ZlJMn81vmce8byGSec6V X-Received: by 2002:a50:95c1:: with SMTP id x1mr572925eda.180.1569454162326; Wed, 25 Sep 2019 16:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569454162; cv=none; d=google.com; s=arc-20160816; b=xkPSadFLzAg0H/W9jLpwD3nvZAEmLFtt3otNbKS5gF6q604CL8PhgyntYuIa40dZ0I uPjeuDULtNwTyQQM4so0qF7/eZ0IABqGuOLmvWCtP07PmaKBjY5RSm/Kqv3CaEo8j9+E YQlfIWYS1W2WdDNoN+D1N0uhSyY0daxJS2X8LBfxNOlubxkovp+XF/sBkvWqAGicAIy1 jnuXAwQPdx15VGsC1xtW2kOntoYOW7nH8Cm0Ogpg3ajPVxg9RfxKLGWOc2vaSR2P8VQk ryWvgs4JUJGAn86eHRvle3QF35oM/HtKwk8JBOxA8sadXfTGG5SY6Vj4eq7VHkp91Wh+ PURA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=tyY6f6pOjNJDATS9u4tbyJncZ8PwKCLPmdXUXKwsvLw=; b=GyTTbrnn3wusXcE9/5jhmMMvP383qzOKOpbgN1cm/M0dpVlxTY1fiUuQqHuddwAB0L fDJX64vI+7sbhiLhfSALW0attb8TZGD0xRN5pSlKHoZhg1dIuIQyoR/MGtWIVPfFm9fS 5VR5b0vNIcljk8Usca1CUT44S+k7fLpTydhOzX1z+42+BmkikCFdTAnP9nwlDsKeojAT 1Hpt0Dumvm9uEoAKgZB1ZqHsFowWAQ6b87vbQxAk0oF7N1y4bSH5oPgftOjQ4ohYGLbG OUGQ/6rjfFC1c7mIXAc27GmPl+PgnWzizqUjhtnefybQe7hd4ibYpdLHj/t1BC8m+tSa n9Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si289351edd.290.2019.09.25.16.28.58; Wed, 25 Sep 2019 16:29:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502469AbfIWT66 (ORCPT + 99 others); Mon, 23 Sep 2019 15:58:58 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59773 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbfIWT66 (ORCPT ); Mon, 23 Sep 2019 15:58:58 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1iCUU1-00059w-Uh; Mon, 23 Sep 2019 21:58:54 +0200 From: John Ogness To: He Zhe Cc: Petr Mladek , Sergey Senozhatsky , , , Subject: Re: [PATCH] printk: Fix unnecessary returning broken pipe error from devkmsg_read References: <1568813503-420025-1-git-send-email-zhe.he@windriver.com> <20190923100513.GA51932@jagdpanzerIV> <027b2f0d-b7dc-4e76-22a7-ce80c9a0aade@windriver.com> <20190923113936.73lhmpxurynem62e@pathway.suse.cz> <6b73354a-c61e-b92c-41f4-0edcb2372952@windriver.com> Date: Mon, 23 Sep 2019 21:58:51 +0200 In-Reply-To: <6b73354a-c61e-b92c-41f4-0edcb2372952@windriver.com> (He Zhe's message of "Mon, 23 Sep 2019 22:11:44 +0800") Message-ID: <87d0fq239g.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-09-23, He Zhe wrote: >>>>> When users read the buffer from start, there is no need to return -EPIPE >>>>> since the possible overflows will not affect the output. >>>>> >>>> [..] >>>>> - if (user->seq < log_first_seq) { >>>>> + if (user->seq == 0) { >>>>> + user->seq = log_first_seq; >>>>> + } else if (user->seq < log_first_seq) { >>>>> /* our last seen message is gone, return error and reset */ >>>>> user->idx = log_first_idx; >>>>> user->seq = log_first_seq; >> >> IMHO, the patch is wrong. > > If this is the case, I'm going to submit a patch for RT kernel. It should be enough just to remove the if-branch. FYI, this bug only exists in the RFCv1 of my proposed printk patchset, which is what RT 5.x is based on. The code currently being prepared for mainline does not have this issue. Thanks for reporting. Looking forward to your patch. John Ogness