lkml.org 
[lkml]   [2020]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] fs: don't allow kernel reads and writes without iter ops
On Fri, Jun 26, 2020 at 02:51:47PM +0100, Matthew Wilcox wrote:
> On Fri, Jun 26, 2020 at 09:58:35AM +0200, Christoph Hellwig wrote:
> > +static void warn_unsupported(struct file *file, const char *op)
> > +{
> > + char pathname[128], *path;
> > +
> > + path = file_path(file, pathname, sizeof(pathname));
> > + if (IS_ERR(path))
> > + path = "(unknown)";
> > + pr_warn_ratelimited(
> > + "kernel %s not supported for file %s (pid: %d comm: %.20s)\n",
> > + op, path, current->pid, current->comm);
> > +}
> > +
>
> how about just:
>
> pr_warn_ratelimited(
> "kernel %s not supported for file %pD4 (pid: %d comm: %.20s)\n",
> op, file, current->pid, current->comm);

Sure, we could use %pD for a few less line of code and a little less
typesafety. I'm not a huge fan of these custom, unchecked format
specifiers, but given that they exist we might a well use them.

\
 
 \ /
  Last update: 2020-06-27 09:11    [W:0.075 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site