From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753976AbbBACCf (ORCPT ); Sat, 31 Jan 2015 21:02:35 -0500 Received: from imap.thunk.org ([74.207.234.97]:47305 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbbBACCe (ORCPT ); Sat, 31 Jan 2015 21:02:34 -0500 Date: Sat, 31 Jan 2015 21:02:30 -0500 From: "Theodore Ts'o" To: Jeremiah Mahler , linux-kernel@vger.kernel.org Subject: Re: [BUG, bisect] hang when copying large file to disc Message-ID: <20150201020230.GA3070@thunk.org> Mail-Followup-To: Theodore Ts'o , Jeremiah Mahler , linux-kernel@vger.kernel.org References: <20150131034051.GA1289@hudson.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150131034051.GA1289@hudson.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 30, 2015 at 07:40:51PM -0800, Jeremiah Mahler wrote: > > If a large file (> 1 GB) is transferred from a USB stick or a mmc > to an local disc (using ext4), it will proceed normally until it > has transferred approximately 600 MB. Then the speed will drop off > to zero and the terminal performing the operation will usually > hang. And sometimes other terminals will hang as well. A reboot > is required to get the system working again. > > mount /dev/sdb1 /mnt > pv /mnt/large_file > large_file_out > (... ~600 MB ... hang) > > I have performed a bisect and found that commit ef39794651347 introduced > the bug. This commit is present in the latest -next 20150130. Thanks for the bug report. I was able to reproduce the problem, and found the problem. Unfortunately I accidentally introduce this in my most recent patchset. I'll fix it up, but here is the patch until I get the a new version pushed out. diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 82c2984..0046861 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1192,9 +1192,9 @@ void __mark_inode_dirty(struct inode *inode, int flags) trace_writeback_dirty_inode(inode, flags); } - dirtytime = flags & I_DIRTY_TIME; if (flags & I_DIRTY_INODE) flags &= ~I_DIRTY_TIME; + dirtytime = flags & I_DIRTY_TIME; /* * Paired with smp_mb() in __writeback_single_inode() for the - Ted