Miao Xie
19fd294957
btrfs: fix wrong reservation when doing delayed inode operations
We have migrated the space for the delayed inode items from
trans_block_rsv to global_block_rsv, but we forgot to set trans->block_rsv to
global_block_rsv when we doing delayed inode operations, and the following Oops
happened:
[ 9792.654889] ------------[ cut here ]------------
[ 9792.654898] WARNING: at fs/btrfs/extent-tree.c:5681
btrfs_alloc_free_block+0xca/0x27c [btrfs]()
[ 9792.654899] Hardware name: To Be Filled By O.E.M.
[ 9792.654900] Modules linked in: btrfs zlib_deflate libcrc32c
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables
arc4 rt61pci rt2x00pci rt2x00lib snd_hda_codec_hdmi mac80211
snd_hda_codec_realtek cfg80211 snd_hda_intel edac_core snd_seq rfkill
pcspkr serio_raw snd_hda_codec eeprom_93cx6 edac_mce_amd sp5100_tco
i2c_piix4 k10temp snd_hwdep snd_seq_device snd_pcm floppy r8169 xhci_hcd
mii snd_timer snd soundcore snd_page_alloc ipv6 firewire_ohci pata_acpi
ata_generic firewire_core pata_via crc_itu_t radeon ttm drm_kms_helper
drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
[ 9792.654919] Pid: 2762, comm: rm Tainted: G W 2.6.39+ #1
[ 9792.654920] Call Trace:
[ 9792.654922] [<ffffffff81053c4a>] warn_slowpath_common+0x83/0x9b
[ 9792.654925] [<ffffffff81053c7c>] warn_slowpath_null+0x1a/0x1c
[ 9792.654933] [<ffffffffa038e747>] btrfs_alloc_free_block+0xca/0x27c [btrfs]
[ 9792.654945] [<ffffffffa03b8562>] ? map_extent_buffer+0x6e/0xa8 [btrfs]
[ 9792.654953] [<ffffffffa038189b>] __btrfs_cow_block+0xfc/0x30c [btrfs]
[ 9792.654963] [<ffffffffa0396aa6>] ? btrfs_buffer_uptodate+0x47/0x58 [btrfs]
[ 9792.654970] [<ffffffffa0382e48>] ? read_block_for_search+0x94/0x368 [btrfs]
[ 9792.654978] [<ffffffffa0381ba9>] btrfs_cow_block+0xfe/0x146 [btrfs]
[ 9792.654986] [<ffffffffa03848b0>] btrfs_search_slot+0x14d/0x4b6 [btrfs]
[ 9792.654997] [<ffffffffa03b8562>] ? map_extent_buffer+0x6e/0xa8 [btrfs]
[ 9792.655022] [<ffffffffa03938e8>] btrfs_lookup_inode+0x2f/0x8f [btrfs]
[ 9792.655025] [<ffffffff8147afac>] ? _cond_resched+0xe/0x22
[ 9792.655027] [<ffffffff8147b892>] ? mutex_lock+0x29/0x50
[ 9792.655039] [<ffffffffa03d41b1>] btrfs_update_delayed_inode+0x72/0x137 [btrfs]
[ 9792.655051] [<ffffffffa03d4ea2>] btrfs_run_delayed_items+0x90/0xdb [btrfs]
[ 9792.655062] [<ffffffffa039a69b>] btrfs_commit_transaction+0x228/0x654 [btrfs]
[ 9792.655064] [<ffffffff8106e8da>] ? remove_wait_queue+0x3a/0x3a
[ 9792.655075] [<ffffffffa03a2fa5>] btrfs_evict_inode+0x14d/0x202 [btrfs]
[ 9792.655077] [<ffffffff81132bd6>] evict+0x71/0x111
[ 9792.655079] [<ffffffff81132de0>] iput+0x12a/0x132
[ 9792.655081] [<ffffffff8112aa3a>] do_unlinkat+0x106/0x155
[ 9792.655083] [<ffffffff81127b83>] ? path_put+0x1f/0x23
[ 9792.655085] [<ffffffff8109c53c>] ? audit_syscall_entry+0x145/0x171
[ 9792.655087] [<ffffffff81128410>] ? putname+0x34/0x36
[ 9792.655090] [<ffffffff8112b441>] sys_unlinkat+0x29/0x2b
[ 9792.655092] [<ffffffff81482c42>] system_call_fastpath+0x16/0x1b
[ 9792.655093] ---[ end trace 02b696eb02b3f768 ]---
This patch fix it by setting the reservation of the transaction handle to the
correct one.
Reported-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-06-17 14:54:18 -04:00
..
2011-04-15 15:26:14 -05:00
2011-03-31 11:26:23 -03:00
2011-03-24 10:16:26 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-24 10:16:26 -07:00
2011-06-17 14:54:18 -04:00
2011-03-31 11:26:23 -03:00
2011-05-11 10:44:48 -07:00
2011-05-17 20:54:04 +00:00
2011-03-25 17:45:16 -07:00
2011-05-18 04:08:16 -07:00
2011-01-13 08:03:23 -08:00
2011-02-18 08:07:18 -08:00
2011-03-22 17:44:17 -07:00
2011-03-31 11:26:23 -03:00
2011-04-25 18:49:46 -05:00
2011-03-10 08:52:07 +01:00
2011-03-31 11:26:23 -03:00
2011-03-15 02:21:44 -04:00
2011-03-31 11:26:23 -03:00
2011-04-08 07:35:17 -07:00
2011-04-11 15:45:47 -07:00
2011-03-24 10:16:26 -07:00
2011-03-31 11:26:23 -03:00
2011-01-14 09:23:36 -08:00
2011-05-10 17:35:58 +02:00
2011-04-25 18:14:10 -07:00
2011-03-24 10:16:26 -07:00
2011-03-24 10:16:26 -07:00
2011-01-12 20:03:42 -05:00
2011-05-09 09:04:24 -07:00
2011-01-07 17:50:26 +11:00
2011-03-22 17:44:02 -07:00
2011-03-24 10:16:26 -07:00
2011-03-31 11:26:23 -03:00
2011-04-11 15:45:47 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-25 15:24:47 -05:00
2011-05-03 16:10:25 -07:00
2011-03-24 10:16:26 -07:00
2011-03-31 11:26:23 -03:00
2011-05-11 22:52:13 -04:00
2011-03-31 11:26:23 -03:00
2011-04-20 11:03:01 -04:00
2011-05-10 22:19:50 +09:00
2011-04-07 11:14:49 -07:00
2011-03-31 11:26:23 -03:00
2011-05-13 11:27:30 -07:00
2011-03-24 10:16:26 -07:00
2011-01-07 17:50:26 +11:00
2011-05-06 07:46:37 -07:00
2011-05-09 16:22:07 -07:00
2011-03-31 11:26:23 -03:00
2011-03-10 08:52:07 +01:00
2011-04-08 07:35:17 -07:00
2011-04-14 16:06:56 -07:00
2011-03-31 11:26:23 -03:00
2011-01-07 17:50:26 +11:00
2011-03-31 11:26:23 -03:00
2011-01-20 17:02:05 -08:00
2011-03-24 10:16:26 -07:00
2011-05-02 19:23:48 +03:00
2011-03-24 10:16:26 -07:00
2011-04-07 11:14:49 -07:00
2011-05-09 18:35:04 -05:00
2011-03-24 10:16:26 -07:00
2011-01-16 13:47:07 -05:00
2011-03-31 11:26:23 -03:00
2011-01-07 17:50:29 +11:00
2010-10-14 10:57:40 -07:00
2010-06-01 08:11:06 -07:00
2011-04-14 16:06:55 -07:00
2011-03-31 11:26:23 -03:00
2010-10-29 04:16:28 -04:00
2010-08-17 18:07:43 -07:00
2011-03-17 11:11:05 +01:00
2011-03-31 11:26:23 -03:00
2011-04-29 10:17:26 +02:00
2011-03-24 19:01:30 -07:00
2011-01-13 10:45:01 -08:00
2011-01-07 14:39:20 -08:00
2011-03-21 00:16:08 -04:00
2011-04-25 18:14:10 -07:00
2011-03-24 10:16:26 -07:00
2011-03-24 21:16:32 -04:00
2011-02-21 15:07:04 -08:00
2011-03-31 11:26:23 -03:00
2011-03-21 00:16:09 -04:00
2011-03-23 19:47:13 -07:00
2011-04-14 16:06:56 -07:00
2011-03-21 00:16:09 -04:00
2011-03-16 13:26:17 -07:00
2011-04-28 11:28:20 -07:00
2011-04-17 10:42:01 -07:00
2011-01-16 13:47:07 -05:00
2011-03-31 11:26:23 -03:00
2011-03-23 19:47:13 -07:00
2011-04-05 23:51:48 +02:00
2011-03-24 21:17:51 -04:00
2011-03-21 00:16:08 -04:00
2010-11-15 10:23:31 +01:00
2011-03-16 19:01:29 -07:00
2010-10-27 18:03:12 -07:00
2011-01-12 20:03:43 -05:00
2011-03-24 08:20:39 -07:00
2011-03-16 19:01:29 -07:00
2011-03-31 11:26:23 -03:00
2011-03-10 08:52:26 +01:00
2011-05-13 11:51:01 -07:00
2011-04-12 13:35:56 -07:00
2011-03-14 09:15:28 -04:00
2010-10-15 15:53:27 +02:00
2011-03-21 01:10:41 -04:00
2011-01-20 16:21:59 -08:00
2011-01-07 17:50:33 +11:00
2011-01-25 15:24:47 -05:00
2011-01-12 20:06:58 -05:00
2010-08-09 20:45:05 -07:00
2011-03-21 00:16:08 -04:00
2010-10-25 21:26:12 -04:00
2010-10-26 10:13:10 -07:00
2011-01-13 10:45:01 -08:00
2011-03-15 02:21:45 -04:00
2011-03-14 09:15:28 -04:00
2011-03-24 10:16:26 -07:00
2011-03-24 10:16:26 -07:00
2010-10-15 15:53:27 +02:00
2011-03-23 19:47:13 -07:00
2011-04-21 07:34:44 -07:00