From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Behrens Subject: [BUG] sleeping function called from atomic context Date: Fri, 04 May 2012 12:18:51 +0200 Message-ID: <4FA3AD0B.7040500@giantdisaster.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 To: Linux Btrfs List Return-path: List-ID: Looks like after "btrfs read error corrected" of chunk tree block while reading the chunk tree in open_ctree(), we stay in atomic state (in 3.4-rc5). The steps: # mkfs.btrfs -d raid1 -m raid1 /dev/sdv /dev/sdw /dev/sdi # mount /dev/sdv /mnt fill /mnt to 25% full # umount /mnt disconnect /dev/sdw # mount /dev/sdv /mnt -o degraded fill /mnt to 50% full # umount /mnt reconnect /dev/sdw # mount /dev/sdv /mnt Block 20971520 is the chunk tree node on /dev/sdw. Here's the kernel log, and the short btrfs-debug-tree output of the chunk tree is located at the end of the mail: sd 6:0:27:0: [sdw] Attached SCSI disk device fsid 7e1ea62e-7d32-4c11-bc02-1bc197be8f54 devid 1 transid 41 /dev/sdv btrfs: disk space caching is enabled parent transid verify failed on 20971520 wanted 38 found 12 btrfs read error corrected: ino 1 off 20971520 (dev /dev/sdw sector 2048) BUG: sleeping function called from invalid context at mm/slub.c:937 in_atomic(): 1, irqs_disabled(): 0, pid: 5955, name: mount INFO: lockdep is turned off. Pid: 5955, comm: mount Tainted: G W 3.3.0+ #57 Call Trace: [] __might_sleep+0xe1/0x110 [] kmem_cache_alloc+0x4d/0x160 [] ? __lock_page+0x70/0x70 [] alloc_extent_state+0x2b/0xf0 [btrfs] [] __set_extent_bit+0x357/0x590 [btrfs] [] lock_extent_bits+0x6c/0xa0 [btrfs] [] verify_parent_transid+0x84/0x160 [btrfs] [] btrfs_buffer_uptodate+0x46/0x60 [btrfs] [] read_block_for_search+0x14d/0x3b0 [btrfs] [] ? generic_bin_search+0xfd/0x180 [btrfs] [] btrfs_search_slot+0x2f4/0x8c0 [btrfs] [] btrfs_read_chunk_tree+0xd5/0x700 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] ? read_extent_buffer+0xb3/0x110 [btrfs] [] ? btrfs_root_node+0x8a/0xf0 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] open_ctree+0x1185/0x1c00 [btrfs] [] btrfs_mount+0x45f/0x530 [btrfs] [] ? mutex_unlock+0x9/0x10 [] ? pcpu_alloc+0x399/0xa00 [] ? alloc_vfsmnt+0x9a/0x1b0 [] mount_fs+0x3e/0x1a0 [] ? alloc_vfsmnt+0xb6/0x1b0 [] vfs_kern_mount+0x5b/0xe0 [] do_kern_mount+0x4d/0x110 [] ? security_capable+0x13/0x20 [] do_mount+0x24d/0x7c0 [] ? memdup_user+0x46/0x90 [] ? strndup_user+0x53/0x70 [] sys_mount+0x8b/0xe0 [] system_call_fastpath+0x16/0x1b parent transid verify failed on 20975616 wanted 38 found 13 BUG: sleeping function called from invalid context at mm/slub.c:937 in_atomic(): 1, irqs_disabled(): 0, pid: 5955, name: mount INFO: lockdep is turned off. Pid: 5955, comm: mount Tainted: G W 3.3.0+ #57 Call Trace: [] __might_sleep+0xe1/0x110 [] ? vprintk+0x309/0x4d0 [] kmem_cache_alloc+0x4d/0x160 [] alloc_extent_state+0x2b/0xf0 [btrfs] [] clear_extent_bit+0x255/0x430 [btrfs] [] unlock_extent_cached+0x24/0x30 [btrfs] [] verify_parent_transid+0xf3/0x160 [btrfs] [] btrfs_buffer_uptodate+0x46/0x60 [btrfs] [] read_block_for_search+0x14d/0x3b0 [btrfs] [] ? generic_bin_search+0xfd/0x180 [btrfs] [] btrfs_search_slot+0x2f4/0x8c0 [btrfs] [] btrfs_read_chunk_tree+0xd5/0x700 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] ? read_extent_buffer+0xb3/0x110 [btrfs] [] ? btrfs_root_node+0x8a/0xf0 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] open_ctree+0x1185/0x1c00 [btrfs] [] btrfs_mount+0x45f/0x530 [btrfs] [] ? mutex_unlock+0x9/0x10 [] ? pcpu_alloc+0x399/0xa00 [] ? alloc_vfsmnt+0x9a/0x1b0 [] mount_fs+0x3e/0x1a0 [] ? alloc_vfsmnt+0xb6/0x1b0 [] vfs_kern_mount+0x5b/0xe0 [] do_kern_mount+0x4d/0x110 [] ? security_capable+0x13/0x20 [] do_mount+0x24d/0x7c0 [] ? memdup_user+0x46/0x90 [] ? strndup_user+0x53/0x70 [] sys_mount+0x8b/0xe0 [] system_call_fastpath+0x16/0x1b parent transid verify failed on 20975616 wanted 38 found 13 btrfs read error corrected: ino 1 off 20975616 (dev /dev/sdw sector 2056) BUG: sleeping function called from invalid context at mm/slub.c:937 in_atomic(): 1, irqs_disabled(): 0, pid: 5955, name: mount INFO: lockdep is turned off. Pid: 5955, comm: mount Tainted: G W 3.3.0+ #57 Call Trace: [] __might_sleep+0xe1/0x110 [] kmem_cache_alloc+0x4d/0x160 [] ? __lock_page+0x70/0x70 [] alloc_extent_state+0x2b/0xf0 [btrfs] [] __set_extent_bit+0x357/0x590 [btrfs] [] lock_extent_bits+0x6c/0xa0 [btrfs] [] verify_parent_transid+0x84/0x160 [btrfs] [] btrfs_buffer_uptodate+0x46/0x60 [btrfs] [] read_block_for_search+0x14d/0x3b0 [btrfs] [] ? btrfs_search_slot+0x823/0x8c0 [btrfs] [] ? _raw_spin_unlock+0x26/0x40 [] btrfs_next_leaf+0x229/0x3e0 [btrfs] [] ? read_one_chunk+0x2ae/0x2d0 [btrfs] [] btrfs_read_chunk_tree+0x93/0x700 [btrfs] [] ? read_extent_buffer+0xb3/0x110 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] open_ctree+0x1185/0x1c00 [btrfs] [] btrfs_mount+0x45f/0x530 [btrfs] [] ? mutex_unlock+0x9/0x10 [] ? pcpu_alloc+0x399/0xa00 [] ? alloc_vfsmnt+0x9a/0x1b0 [] mount_fs+0x3e/0x1a0 [] ? alloc_vfsmnt+0xb6/0x1b0 [] vfs_kern_mount+0x5b/0xe0 [] do_kern_mount+0x4d/0x110 [] ? security_capable+0x13/0x20 [] do_mount+0x24d/0x7c0 [] ? memdup_user+0x46/0x90 [] ? strndup_user+0x53/0x70 [] sys_mount+0x8b/0xe0 [] system_call_fastpath+0x16/0x1b parent transid verify failed on 20979712 wanted 38 found 10 BUG: sleeping function called from invalid context at mm/slub.c:937 in_atomic(): 1, irqs_disabled(): 0, pid: 5955, name: mount INFO: lockdep is turned off. Pid: 5955, comm: mount Tainted: G W 3.3.0+ #57 Call Trace: [] __might_sleep+0xe1/0x110 [] ? vprintk+0x309/0x4d0 [] kmem_cache_alloc+0x4d/0x160 [] alloc_extent_state+0x2b/0xf0 [btrfs] [] clear_extent_bit+0x255/0x430 [btrfs] [] unlock_extent_cached+0x24/0x30 [btrfs] [] verify_parent_transid+0xf3/0x160 [btrfs] [] btrfs_buffer_uptodate+0x46/0x60 [btrfs] [] read_block_for_search+0x14d/0x3b0 [btrfs] [] ? btrfs_search_slot+0x823/0x8c0 [btrfs] [] ? _raw_spin_unlock+0x26/0x40 [] btrfs_next_leaf+0x229/0x3e0 [btrfs] [] ? read_one_chunk+0x2ae/0x2d0 [btrfs] [] btrfs_read_chunk_tree+0x93/0x700 [btrfs] [] ? read_extent_buffer+0xb3/0x110 [btrfs] [] ? btrfs_root_node+0x28/0xf0 [btrfs] [] open_ctree+0x1185/0x1c00 [btrfs] [] btrfs_mount+0x45f/0x530 [btrfs] [] ? mutex_unlock+0x9/0x10 [] ? pcpu_alloc+0x399/0xa00 [] ? alloc_vfsmnt+0x9a/0x1b0 [] mount_fs+0x3e/0x1a0 [] ? alloc_vfsmnt+0xb6/0x1b0 [] vfs_kern_mount+0x5b/0xe0 [] do_kern_mount+0x4d/0x110 [] ? security_capable+0x13/0x20 [] do_mount+0x24d/0x7c0 [] ? memdup_user+0x46/0x90 [] ? strndup_user+0x53/0x70 [] sys_mount+0x8b/0xe0 [] system_call_fastpath+0x16/0x1b parent transid verify failed on 20979712 wanted 38 found 10 btrfs read error corrected: ino 1 off 20979712 (dev /dev/sdw sector 2064) Btrfs detected SSD devices, enabling SSD mode chunk tree node 20971520 level 1 items 2 free 119 generation 38 owner 3 fs uuid 7e1ea62e-7d32-4c11-bc02-1bc197be8f54 chunk uuid f59ccfe4-7257-4430-8556-f5e578464a38 key (DEV_ITEMS DEV_ITEM 1) block 20975616 (5121) gen 38 key (FIRST_CHUNK_TREE CHUNK_ITEM 24725422080) block 20979712 (5122) gen 38