From patchwork Wed Jan 27 01:44:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Angielski X-Patchwork-Id: 43761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4290FB7CF3 for ; Wed, 27 Jan 2010 12:47:15 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NZwxO-0002xD-W8; Wed, 27 Jan 2010 01:44:35 +0000 Received: from mail.theptrgroup.com ([71.178.251.9]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NZwxL-0002wy-CS for linux-mtd@lists.infradead.org; Wed, 27 Jan 2010 01:44:32 +0000 Received: from [10.11.13.30] (unknown [10.11.13.30]) by mail.theptrgroup.com (Postfix) with ESMTP id D5905E0815; Tue, 26 Jan 2010 20:43:13 -0500 (EST) Message-ID: <4B5F9A78.7080000@theptrgroup.com> Date: Tue, 26 Jan 2010 20:44:24 -0500 From: Jeff Angielski User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: dedekind1@gmail.com Subject: Re: UBIFS assert failed in ubifs_dirty_inode References: <4B591573.60602@theptrgroup.com> <1264480808.2401.78.camel@localhost.localdomain> <1264484928.3536.1017.camel@calx> <1264500214.3867.21.camel@localhost> In-Reply-To: <1264500214.3867.21.camel@localhost> X-Spam-Note: CRM114 run bypassed due to message size (128639 bytes) X-Spam-Note: SpamAssassin run bypassed due to message size (128639 bytes) Cc: Herbert Xu , linux-mtd@lists.infradead.org, LKML , Matt Mackall X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Artem Bityutskiy wrote: > On Mon, 2010-01-25 at 23:48 -0600, Matt Mackall wrote: >> Hmm. I'd just as soon drop it entirely. Here's a patch. Herbert, you >> want to send this through your crypto tree? >> >> >> random: drop weird m_time/a_time manipulation >> >> No other driver does anything remotely like this that I know of except >> for the tty drivers, and I can't see any reason for random/urandom to do >> it. In fact, it's a (trivial, harmless) timing information leak. And >> obviously, it generates power- and flash-cycle wasting I/O, especially >> if combined with something like hwrngd. Also, it breaks ubifs's >> expectations. >> >> Signed-off-by: Matt Mackall >> >> diff -r 29db0c391ce8 drivers/char/random.c >> --- a/drivers/char/random.c Sun Jan 17 11:01:16 2010 -0800 >> +++ b/drivers/char/random.c Mon Jan 25 23:32:00 2010 -0600 >> @@ -1051,12 +1051,6 @@ >> /* like a named pipe */ >> } >> >> - /* >> - * If we gave the user some bytes, update the access time. >> - */ >> - if (count) >> - file_accessed(file); >> - >> return (count ? count : retval); >> } >> >> @@ -1116,8 +1110,6 @@ >> if (ret) >> return ret; >> >> - inode->i_mtime = current_fs_time(inode->i_sb); >> - mark_inode_dirty(inode); >> return (ssize_t)count; >> } > > It may brake other FSes expectations, theoretically, as well. > > Anyway, I'm perfectly fine if this is removed. > > Jeff, could you please try Matt's patch and report back if you still > have issues or not. If no, you can use this as a temporary work-around > until a proper fix hits upstream or ubifs-2.6.git. Matt's patch did not compile as written. I tried to implement what I think he was trying to do and created this patch (it seems to match the guts of what inode_setattr() was looking for): if (ret) @@ -1116,8 +1117,12 @@ static ssize_t random_write(struct file *file, const char __user *buffer, if (ret) return ret; - inode->i_mtime = current_fs_time(inode->i_sb); - mark_inode_dirty(inode); + attr.ia_mtime = current_fs_time(inode->i_sb); + attr.ia_valid = ATTR_MTIME; + ret = inode_setattr(inode, &attr); + if (ret) + return ret; + return (ssize_t)count; } However, this patch does not fix the problem. I still see the same errors. Matt, is this what you were trying to do? I've also included the console dump just in case. I did try Artem's patch that removes the offending code and that works fine. No problems on any reboots or reading/writing the UBIFS. diff --git a/drivers/char/random.c b/drivers/char/random.c index 8258982..70f16c7 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1108,6 +1108,7 @@ static ssize_t random_write(struct file *file, const char __user *buffer, { size_t ret; struct inode *inode = file->f_path.dentry->d_inode; + struct iattr attr; ret = write_pool(&blocking_pool, buffer, count);