Re: udev breakages - was: Re: Need of an ".async_probe()" type ofcallback at driver's core - Was: Re: [PATCH] [media] drxk: change it to userequest_firmware_nowait()

From: Al Viro
Date: Wed Oct 03 2012 - 15:26:46 EST


On Wed, Oct 03, 2012 at 10:32:08AM -0700, Linus Torvalds wrote:
> On Wed, Oct 3, 2012 at 10:09 AM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > + if (!S_ISREG(inode->i_mode))
> > + return false;
> > + size = i_size_read(inode);
> >
> > Probably better to do vfs_getattr() and check mode and size in kstat; if
> > it's sufficiently hot for that to hurt, we are fucked anyway.
> >
> > + file = filp_open(path, O_RDONLY, 0);
> > + if (IS_ERR(file))
> > + continue;
> > +printk("from file '%s' ", path);
> > + success = fw_read_file_contents(file, fw);
> > + filp_close(file, NULL);
> >
> > fput(file), please. We have enough misuses of filp_close() as it is...
>
> Ok, like this?

Looks sane. TBH, I'd still prefer to see udev forcibly taken over and put into
usr/udev in kernel tree - I don't trust that crowd at all and the fewer
critical userland bits they can play leverage games with, the safer we are.

Al, that -><- close to volunteering for maintaining that FPOS kernel-side...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/