From patchwork Wed Oct 23 10:43:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lothar_Wa=C3=9Fmann?= X-Patchwork-Id: 285636 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E65142C0443 for ; Wed, 23 Oct 2013 21:45:13 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYvvg-0002Us-Uj; Wed, 23 Oct 2013 10:44:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYvve-0002s4-I5; Wed, 23 Oct 2013 10:44:42 +0000 Received: from mail.karo-electronics.de ([81.173.242.67]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYvvb-0002qm-4F for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2013 10:44:40 +0000 Date: Wed, 23 Oct 2013 12:43:33 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Ming Lei Subject: Re: userspace firmware load fails with current linux-next Message-ID: <20131023124333.356d0e15@ipc1.ka-ro> In-Reply-To: <20131023182609.6646b5c0@tom-ThinkPad-T410> References: <20131023110618.7bd07899@ipc1.ka-ro> <20131023182609.6646b5c0@tom-ThinkPad-T410> Organization: Ka-Ro electronics GmbH X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131023_064439_312895_CCD9E5AE X-CRM114-Status: GOOD ( 13.69 ) X-Spam-Score: -3.0 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [81.173.242.67 listed in list.dnswl.org] -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: tj@kernel.org, tom.leiming@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hi, Ming Lei wrote: > On Wed, 23 Oct 2013 11:06:18 +0200 > Lothar Waßmann wrote: > [...] > > Or is it an unintended side effect of some recent change? > > Maybe yes, could you test below patch? > > Tejun, looks we need to keep special attention on zero size of bin file > as before, could you comment at the patch? > > -- > diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c > index 5d818df..366ae8d 100644 > --- a/fs/sysfs/file.c > +++ b/fs/sysfs/file.c > @@ -277,7 +277,7 @@ static ssize_t sysfs_write_file(struct file *file, const char __user *user_buf, > ssize_t len = min_t(size_t, count, PAGE_SIZE); > char *buf; > > - if (sysfs_is_bin(of->sd)) { > + if (sysfs_is_bin(of->sd) && size) { > loff_t size = file_inode(file)->i_size; > > if (size <= *ppos) > > > The patch as is produces a build error, because 'size' is only defined after the 'if' statement. The modified patch below works for me. Lothar Waßmann diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 5d818df..709d6f5 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -277,7 +277,7 @@ static ssize_t sysfs_write_file(struct file *file, const char __user *user_buf, ssize_t len = min_t(size_t, count, PAGE_SIZE); char *buf; - if (sysfs_is_bin(of->sd)) { + if (sysfs_is_bin(of->sd) && file_inode(file)->i_size) { loff_t size = file_inode(file)->i_size; if (size <= *ppos)