From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from acsinet15.oracle.com ([141.146.126.227]:26413 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342Ab2IZBIK (ORCPT ); Tue, 25 Sep 2012 21:08:10 -0400 Message-ID: <50625569.9040102@oracle.com> Date: Wed, 26 Sep 2012 09:07:53 +0800 From: Liu Bo MIME-Version: 1.0 To: Mitch Harder CC: linux-btrfs@vger.kernel.org, dave@jikos.cz Subject: Re: [PATCH 2/2 v3] Btrfs: snapshot-aware defrag References: <1347875936-14165-1-git-send-email-bo.li.liu@oracle.com> <1347875936-14165-2-git-send-email-bo.li.liu@oracle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 09/26/2012 01:39 AM, Mitch Harder wrote: > On Mon, Sep 17, 2012 at 4:58 AM, Liu Bo wrote: >> This comes from one of btrfs's project ideas, >> As we defragment files, we break any sharing from other snapshots. >> The balancing code will preserve the sharing, and defrag needs to grow this >> as well. >> >> Now we're able to fill the blank with this patch, in which we make full use of >> backref walking stuff. >> >> Here is the basic idea, >> o set the writeback ranges started by defragment with flag EXTENT_DEFRAG >> o at endio, after we finish updating fs tree, we use backref walking to find >> all parents of the ranges and re-link them with the new COWed file layout by >> adding corresponding backrefs. >> >> Originally patch by Li Zefan >> Signed-off-by: Liu Bo > > I'm hitting the WARN_ON in record_extent_backrefs() indicating a > problem with the return value from iterate_inodes_from_logical(). > > [ 6865.184782] ------------[ cut here ]------------ > [ 6865.184819] WARNING: at fs/btrfs/inode.c:2062 > record_extent_backrefs+0xe5/0xe7 [btrfs]() > [ 6865.184823] Hardware name: OptiPlex 745 > [ 6865.184825] Modules linked in: lpc_ich mfd_core xts gf128mul cryptd > aes_x86_64 sha256_generic btrfs libcrc32c > [ 6865.184841] Pid: 4239, comm: btrfs-endio-wri Not tainted 3.5.4-git-local+ #1 > [ 6865.184844] Call Trace: > [ 6865.184856] [] warn_slowpath_common+0x74/0xa2 > [ 6865.184862] [] warn_slowpath_null+0x1a/0x1c > [ 6865.184884] [] record_extent_backrefs+0xe5/0xe7 [btrfs] > [ 6865.184908] [] btrfs_finish_ordered_io+0x131/0xa4b [btrfs] > [ 6865.184930] [] finish_ordered_fn+0x15/0x17 [btrfs] > [ 6865.184951] [] worker_loop+0x145/0x516 [btrfs] > [ 6865.184959] [] ? __wake_up_common+0x54/0x84 > [ 6865.184983] [] ? btrfs_queue_worker+0x2d3/0x2d3 [btrfs] > [ 6865.184989] [] kthread+0x93/0x98 > [ 6865.184996] [] kernel_thread_helper+0x4/0x10 > [ 6865.185001] [] ? kthread_freezable_should_stop+0x6a/0x6a > [ 6865.185021] [] ? gs_change+0xb/0xb > [ 6865.185025] ---[ end trace 26cc0e186efc79d8 ]--- > > > I'm testing a 3.5.4 kernel merged with 3.6_rc patchset as well as the > send_recv patches and most of the btrfs-next patches. > > I'm running into this issue when mounting with autodefrag, and running > some snapshot tests. > > This may be related to a problem elsewhere, because I've been > encountering other backref issues even before testing this patch. > Oh, will look into it, thanks for the report. thanks, liubo