Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758187AbZD2IWv (ORCPT ); Wed, 29 Apr 2009 04:22:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757803AbZD2IWd (ORCPT ); Wed, 29 Apr 2009 04:22:33 -0400 Received: from mga14.intel.com ([143.182.124.37]:7812 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755146AbZD2IW2 (ORCPT ); Wed, 29 Apr 2009 04:22:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.40,265,1239001200"; d="scan'208";a="137155820" Date: Wed, 29 Apr 2009 16:21:51 +0800 From: Wu Fengguang To: Chris Mason Cc: Andi Kleen , hugh@veritas.com, npiggin@suse.de, riel@redhat.com, lee.schermerhorn@hp.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, "linux-btrfs@vger.kernel.org" Subject: btrfs BUG on creating huge sparse file Message-ID: <20090429082151.GA15170@localhost> References: <20090407509.382219156@firstfloor.org> <20090407151010.E72A91D0471@basil.firstfloor.org> <1239210239.28688.15.camel@think.oraclecorp.com> <20090409072949.GF14687@one.firstfloor.org> <20090409075805.GG14687@one.firstfloor.org> <1239283829.23150.34.camel@think.oraclecorp.com> <20090409140257.GI14687@one.firstfloor.org> <1239287859.23150.57.camel@think.oraclecorp.com> <20090429081616.GA8339@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090429081616.GA8339@localhost> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7054 Lines: 111 On Wed, Apr 29, 2009 at 04:16:16PM +0800, Wu Fengguang wrote: > On Thu, Apr 09, 2009 at 10:37:39AM -0400, Chris Mason wrote: [snip] > > PagePrivate is very common. try_to_releasepage failing on a clean page > > without the writeback bit set and without dirty/locked buffers will be > > pretty rare. > > Yup. btrfs seems to tag most(if not all) dirty pages with PG_private. > While ext4 won't. Chris, I run into a btrfs BUG() when doing dd if=/dev/zero of=/b/sparse bs=1k count=1 seek=104857512345 The half created sparse file is -rw-r--r-- 1 root root 98T 2009-04-29 14:54 /b/sparse Or -rw-r--r-- 1 root root 107374092641280 2009-04-29 14:54 /b/sparse Below is the kernel messages. I can test patches you throw at me :-) Thanks, Fengguang [ 1067.530868] btrfs allocation failed flags 1, wanted 4096 [ 1067.536313] space_info has 0 free, is full [ 1067.540533] space_info total=4049600512, pinned=0, delalloc=4096, may_use=0, used=4049600512 [ 1067.549280] block group 12582912 has 8388608 bytes, 8388608 used 0 pinned 0 reserved [ 1067.557172] 0 blocks of free space at or bigger than bytes is [ 1067.563020] block group 255918080 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.571334] 0 blocks of free space at or bigger than bytes is [ 1067.577159] block group 709099520 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.585459] 0 blocks of free space at or bigger than bytes is [ 1067.591271] block group 1162280960 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.599641] 0 blocks of free space at or bigger than bytes is [ 1067.605491] block group 1615462400 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.613858] 0 blocks of free space at or bigger than bytes is [ 1067.619684] block group 2068643840 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.628069] 0 blocks of free space at or bigger than bytes is [ 1067.633893] block group 2521825280 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.642277] 0 blocks of free space at or bigger than bytes is [ 1067.648099] block group 2975006720 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.656483] 0 blocks of free space at or bigger than bytes is [ 1067.662295] block group 3428188160 has 453181440 bytes, 453181440 used 0 pinned 0 reserved [ 1067.670666] 0 blocks of free space at or bigger than bytes is [ 1067.676508] block group 3881369600 has 415760384 bytes, 415760384 used 0 pinned 0 reserved [ 1067.684877] 0 blocks of free space at or bigger than bytes is [ 1067.690747] ------------[ cut here ]------------ [ 1067.695435] kernel BUG at fs/btrfs/extent-tree.c:2872! [ 1067.700646] invalid opcode: 0000 [#1] SMP [ 1067.704873] last sysfs file: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/C23B/charge_full [ 1067.714473] CPU 0 [ 1067.716575] Modules linked in: drm iwlagn iwlcore snd_hda_codec_analog snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq snd_timer snd_seq_device snd soundcore snd_page_alloc video [ 1067.733699] Pid: 3358, comm: dd Not tainted 2.6.30-rc2-next-20090417 #202 HP Compaq 6910p [ 1067.741975] RIP: 0010:[] [] __btrfs_reserve_extent+0x213/0x300 [ 1067.751185] RSP: 0018:ffff8800791c77f8 EFLAGS: 00010292 [ 1067.756581] RAX: 0000000000022533 RBX: ffff88007b8c5030 RCX: 0000000000000006 [ 1067.763777] RDX: ffffffff81ccffa0 RSI: ffff8800791c1db0 RDI: 0000000000000286 [ 1067.770984] RBP: ffff8800791c7878 R08: 0000000000000000 R09: 0000000000000000 [ 1067.778203] R10: 0000000000000001 R11: 0000000000000001 R12: ffff88007b38e4b8 [ 1067.785440] R13: 0000000000001000 R14: ffff88007b38e6a8 R15: ffff88007b38e658 [ 1067.792657] FS: 00007f5801f136f0(0000) GS:ffff880005a00000(0000) knlGS:0000000000000000 [ 1067.800851] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 1067.806668] CR2: 00007f58017c1622 CR3: 000000007bb62000 CR4: 00000000000006e0 [ 1067.813882] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1067.821087] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 1067.828304] Process dd (pid: 3358, threadinfo ffff8800791c6000, task ffff8800791c1600) [ 1067.836319] Stack: [ 1067.838389] 0000000000000000 ffff8800791c7948 0000000000000000 0000000000000000 [ 1067.845792] 0000000000000001 0000000000000000 0000000000000000 0000000000000000 [ 1067.853464] ffff88007bbe4000 0000000100000000 0000000000000001 ffff8800791c7948 [ 1067.861360] Call Trace: [ 1067.863863] [] btrfs_reserve_extent+0x3b/0x70 [ 1067.869984] [] cow_file_range+0x21b/0x3d0 [ 1067.875745] [] ? test_range_bit+0xb9/0x180 [ 1067.881616] [] run_delalloc_range+0x302/0x3b0 [ 1067.887727] [] ? test_range_bit+0xb9/0x180 [ 1067.893583] [] ? find_lock_delalloc_range+0x12f/0x1c0 [ 1067.900396] [] __extent_writepage+0x175/0x990 [ 1067.906502] [] ? mark_held_locks+0x68/0x90 [ 1067.912361] [] ? clear_page_dirty_for_io+0x171/0x190 [ 1067.919080] [] ? trace_hardirqs_on_caller+0x16d/0x1c0 [ 1067.925891] [] extent_write_cache_pages+0x1ee/0x400 [ 1067.932529] [] ? flush_write_bio+0x0/0x40 [ 1067.938288] [] ? __extent_writepage+0x0/0x990 [ 1067.944404] [] ? mark_held_locks+0x68/0x90 [ 1067.950254] [] ? kmem_cache_free+0x145/0x260 [ 1067.956287] [] ? trace_hardirqs_on_caller+0x16d/0x1c0 [ 1067.963091] [] extent_writepages+0x42/0x70 [ 1067.968957] [] ? btrfs_get_extent+0x0/0x960 [ 1067.974891] [] btrfs_writepages+0x28/0x30 [ 1067.980663] [] btrfs_fdatawrite_range+0x50/0x60 [ 1067.986942] [] btrfs_wait_ordered_range+0xb6/0x170 [ 1067.993508] [] btrfs_truncate+0x74/0x160 [ 1067.999183] [] vmtruncate+0xad/0x110 [ 1068.004529] [] inode_setattr+0x35/0x180 [ 1068.010116] [] btrfs_setattr+0x6b/0xd0 [ 1068.015616] [] notify_change+0x121/0x330 [ 1068.021298] [] do_truncate+0x6a/0x90 [ 1068.026623] [] sys_ftruncate+0xf0/0x130 [ 1068.032220] [] system_call_fastpath+0x16/0x1b [ 1068.038364] Code: 4c 8d a0 60 fe ff ff 49 8b 84 24 a0 01 00 00 0f 18 08 49 8d 84 24 a0 01 00 00 49 39 c7 0f 85 8c 00 00 00 4c 89 f7 e8 8d 8e e6 ff <0f> 0b eb fe 66 0f 1f 84 00 00 00 00 00 49 d1 ed 41 8b 84 24 60 [ 1068.059472] RIP [] __btrfs_reserve_extent+0x213/0x300 [ 1068.066299] RSP [ 1068.070292] ---[ end trace ab42ff0a881d9568 ]--- -- 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/