Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487Ab2JCT05 (ORCPT ); Wed, 3 Oct 2012 15:26:57 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:56893 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109Ab2JCT0m (ORCPT ); Wed, 3 Oct 2012 15:26:42 -0400 Date: Wed, 3 Oct 2012 20:26:36 +0100 From: Al Viro To: Linus Torvalds Cc: Mauro Carvalho Chehab , Ming Lei , Greg KH , Kay Sievers , Lennart Poettering , Linux Kernel Mailing List , Kay Sievers , Linux Media Mailing List , Michael Krufky , Ivan Kalvachev Subject: Re: udev breakages - was: Re: Need of an ".async_probe()" type of callback at driver's core - Was: Re: [PATCH] [media] drxk: change it to use request_firmware_nowait() Message-ID: <20121003192636.GC23473@ZenIV.linux.org.uk> References: <4FE9169D.5020300@redhat.com> <20121002100319.59146693@redhat.com> <20121002221239.GA30990@kroah.com> <20121002222333.GA32207@kroah.com> <506C562E.5090909@redhat.com> <20121003170907.GA23473@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 31 On Wed, Oct 03, 2012 at 10:32:08AM -0700, Linus Torvalds wrote: > On Wed, Oct 3, 2012 at 10:09 AM, Al Viro 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/