[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180731113422.GA22939@amd>
Date: Tue, 31 Jul 2018 13:34:22 +0200
From: Pavel Machek <pavel@....cz>
To: David Howells <dhowells@...hat.com>
Cc: "Theodore Y. Ts'o" <tytso@....edu>,
Matthew Wilcox <willy@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 36/38] vfs: Add a sample program for the new mount API
[ver #10]
On Tue 2018-07-31 11:11:53, David Howells wrote:
> Pavel Machek <pavel@....cz> wrote:
>
> > Proposal is "message %s foo %s\0param 1\0param2\0", only strings
> > allowed.
>
> I think that's too strict and you will need to allow integer values, IP
> addresses and possibly other things also. It could certainly have a limited
> set (e.g. no kernel pointers).
I'd always use strings at kernel->user interface. Yes, we should
support integers and IP addresses in kernel, but I'd convert them to
strings before passing them to userspace.
> You also haven't proposed what you think the internal interface should look
> like.
No, I did not.
> and then the kernel has to render the whole lot into
>
> Another example, in ext4 we have:
>
> printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d",
>
> so we could do something like:
>
> infof(fc, "EXT4-fs (%s): last error at time %u: %.*s:%d", ...);
>
> on mount. But the use of "%.*s" is a pain for your interface. We can't pass
> qualifiers like "*" to userspace, so either the caller would have to copy the
> string first or the logging routines would have to edit the format string.
> Though I suppose we could leave the editing to userspace.
I guess internal interface can stay the same, at expense of complexity
in infof function. It would data according to %blablax into string,
then replace %blablax with %s. I guess we can keep infof function
simpler by only allowing certain format specifiers...
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists