From: Bruno Meneguele <bmeneg@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
Petr Mladek <pmladek@suse.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
David Laight <David.Laight@aculab.com>
Subject: Re: [PATCH] Revert "kernel/printk: add kmsg SEEK_CUR handling"
Date: Mon, 22 Jun 2020 14:10:01 -0300 [thread overview]
Message-ID: <20200622171001.GF2850@glitch> (raw)
In-Reply-To: <CAHk-=wgR8TZi_M4p3PZQh5nGjUjNBeXqhGyxUe8eykyf8g6p=A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
On Mon, Jun 22, 2020 at 09:42:25AM -0700, Linus Torvalds wrote:
> > Would it make sense to return the next buffer index instead? Basically
> > the same as SEEK_END does? The first "if (offset)" in the function would
> > prevent any real relative move while SEEK_CUR would return a valid
> > address following this buffer behavior of specific points it could seek
> > to.
>
> Maybe. At the same time, the way we don't actually return a real
> position means that that's very dangerous too. We'll always return
> "we're at position zero".
>
> And we never accept byte-by-byte reads and require a "get the whole
> record" model.
>
> So I think we might as well accept "kmsg is special".
>
> I don't have hugely strong opinions on it - I certainly agree that
> "SEEK_CUR with offset zero could be a no-op", but I also don't think
> there's a huge reason to try to change it, considering just _how_
> special kmsg is.
Although both options are pretty fine by me too, I "fear" (not really)
we can end up stacking special behavior interfaces, forcing userspace to
keep a "table of special case files". Personally, I prefer to return
something _valid_ to userspace rather than _fail_ with special meaning.
But in any case I think it's worth adding a note in the docs just to
make sure we have somewhere to point in case they start looking.
Thanks Linus! Will wait some more in case we have other thoughts around
it before posting anything (doc patch or the other approach).
--
bmeneg
PGP Key: http://bmeneg.com/pubkey.txt
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-06-22 17:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 3:02 [PATCH] Revert "kernel/printk: add kmsg SEEK_CUR handling" Jason A. Donenfeld
2020-06-22 3:50 ` Linus Torvalds
2020-06-22 13:37 ` Bruno Meneguele
2020-06-22 16:42 ` Linus Torvalds
2020-06-22 17:10 ` Bruno Meneguele [this message]
2020-06-22 17:32 ` Linus Torvalds
2020-06-22 17:37 ` Bruno Meneguele
2020-07-11 22:28 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200622171001.GF2850@glitch \
--to=bmeneg@redhat.com \
--cc=David.Laight@aculab.com \
--cc=Jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox