Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2440155ybt; Sun, 21 Jun 2020 20:52:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLmnZDP0kpkdQlw7La3TQbSoaZM1sEHWEFwqsCbHLRV9+2/xNumtvb4Ue45BYyWwn1aiHf X-Received: by 2002:a17:906:4ec1:: with SMTP id i1mr13755797ejv.152.1592797962274; Sun, 21 Jun 2020 20:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592797962; cv=none; d=google.com; s=arc-20160816; b=M7IdB1HmS/yt8DGkU9EO93+SL5/+UYxBCpZeg4/DNAgEjRRvA1p3SzDbQdVbPB3tfc mqhnA0B9llehk4yvZj384p1TtjuIn++Jbpiun/Obrrn4LSLdr+wE5jzbI5CkWAEG2uK5 3FZHRi1gpnsOv+d30KKy/9HolEf5t0BmhMrJzKDRqXqFcpq2LpGHHdwOGBpEmZoM+pV9 YY3upqynauWS0/UPiu5qbZDsK20bq5rPLrj7SKmplMr3Aij2w7o/W71GAla5w7XFK49F cOVxVGnk9kwPaH9gMkrh+yP2Hh4W+eDOQovRn2hizA2ulLb9C2eKpc1aEg8XoIM/J1Vs ExnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1MQBHhyMZkPAJV79BAo7BFoOxokarl3OUQ7F4YaqYDg=; b=uAO8UA3qbeQTg6kooutzhKSRm/hJ1HBkMppG1uaKnNgndl0oZli0josuHsXM1lZfdq rZpn0oOMNWcOhBUvtcejVz7XQY+FVgyiQtGB24uiE+kBhK+F84uw7OKT5Na/TczfwbDc BsxMAd8aFqa7EUK1OU2OvKKJTWtEfPgRy4aaABPIUVIrIYbsiKsNZpgsUX04hIQ6e7e4 ufV6Y/cpc7bSUiPlMJnGpPg9jL1OnErTgb8+xLqp9igKdEzZnarHzeY1/OTtAMDBBCra mJyaEeAzW3OXqBYzTL7IC+1zd009RbgwUelEDTUWOWVOTQeze/1f8mvTKHlHAYYhjE4J 7tJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QU7TYK9m; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a24si9793250edm.17.2020.06.21.20.52.20; Sun, 21 Jun 2020 20:52:42 -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=@linux-foundation.org header.s=google header.b=QU7TYK9m; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbgFVDuc (ORCPT + 99 others); Sun, 21 Jun 2020 23:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbgFVDub (ORCPT ); Sun, 21 Jun 2020 23:50:31 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B6CFC061794 for ; Sun, 21 Jun 2020 20:50:30 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id c11so8735838lfh.8 for ; Sun, 21 Jun 2020 20:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1MQBHhyMZkPAJV79BAo7BFoOxokarl3OUQ7F4YaqYDg=; b=QU7TYK9myuQFDbo/upObAnH7FMsutR8r2Xn6J87H0jTWTJOSP0dTiNcnkysYLNorke HYDJlH49PuQvjArWiUtX6qlEvgwys0IoWd9XA2hhAY/UUMW/lndTKZrOtcsoY6Jwkb6L LnwR8MvwtrfvxWGH3T/u7KSBcqVnnCxPXP0NU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1MQBHhyMZkPAJV79BAo7BFoOxokarl3OUQ7F4YaqYDg=; b=kzMt7e8qKKF26yIzb0sBKS5qTyTX6y6924BMNr8r1ITDEUjM1pCtnhqNRYtVuSr/fJ F6uqtw9DvHBUX/xRz0sc4LdI127hhfQRmYbuDvkZ4Z3YY0whQVmsM79Kq7k36xz6EbVM NOButgSLW8IYwur5RATBRmr9uqZkJ/1OBBN5trk9aejIXW8GefQ/TowjoauEcvzIgUyt m29sCzXVbtYqshMAUbQbWhK4gwrM7Fwpf8jZ+G4F8KNjI647J4972XfmQ/QNqZIKOlux 1oBmZndlkHQj0a1h/Td3ll4Vy+xY5VUt21zLOkapGpJNKaG2W8ZahqL0oE8x94scyPF1 g6IQ== X-Gm-Message-State: AOAM531DSmf1sVMXBboxlhkp7e9Y+H0e15XR9jT6xemlpI/cUVUSCn3k K2FdJf79e3VgU66dri0N+93FgMy7Xs8= X-Received: by 2002:a19:4301:: with SMTP id q1mr8568726lfa.96.1592797827265; Sun, 21 Jun 2020 20:50:27 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id l22sm2493348ljg.41.2020.06.21.20.50.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Jun 2020 20:50:26 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id e4so17602338ljn.4 for ; Sun, 21 Jun 2020 20:50:25 -0700 (PDT) X-Received: by 2002:a2e:9cd4:: with SMTP id g20mr7407154ljj.371.1592797825626; Sun, 21 Jun 2020 20:50:25 -0700 (PDT) MIME-Version: 1.0 References: <20200622030222.1370098-1-Jason@zx2c4.com> In-Reply-To: <20200622030222.1370098-1-Jason@zx2c4.com> From: Linus Torvalds Date: Sun, 21 Jun 2020 20:50:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Revert "kernel/printk: add kmsg SEEK_CUR handling" To: "Jason A. Donenfeld" Cc: Petr Mladek , Linux Kernel Mailing List , Bruno Meneguele , Sergey Senozhatsky , Steven Rostedt , David Laight Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 21, 2020 at 8:02 PM Jason A. Donenfeld wrote: > > This reverts commit 8ece3b3eb576a78d2e67ad4c3a80a39fa6708809. > > This commit broke userspace. Bash uses ESPIPE to determine whether or > not the file should be read using "unbuffered I/O", which means reading > 1 byte at a time instead of 128 bytes at a time. Ack. Somewhat odd behavior, but clearly user space depended on the legacy "return EINVAL rather than ESPIPE" behavior. I do think there are other reasons to not return ESPIPE. The fact is, the printk buffer _is_ seekable, it's just relative seeking that doesn't work. You can seek to the beginning and the end and a particular offset, just not relative. So I kind of see why people wanted to return ESPIPE, but at the same time it really is very misleading: ESPIPE is for pure streams that can't lseek at all. The fact that some silly shell internal then reacts very badly to that may be extreme, but it may be as well as you can do it you worry about leaving data for the next user. I've applied the revert. Linus