From mboxrd@z Thu Jan 1 00:00:00 1970 From: dima Subject: Corrupt file in subvolume Date: Mon, 10 Oct 2011 02:14:26 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-btrfs@vger.kernel.org Return-path: List-ID: Hello, Somehow my subvolume with /home got corrupted. When I booted the machine this morning (after perfectly normal shutdown) it gave me a bunch of kernel errors. I found out that if I comment out my /home entry in fstab, it would boot ok. So the / is not corrupted. I then booted from the live CD and set "clear_cache" for /home instead of "inode_cache,space_cache" /dev/disk/by-label/btrfs-root / btrfs defaults,noatime,inode_cache,space_cache 0 0 /dev/disk/by-label/btrfs-root /var/lib/btrfs-root btrfs defaults,noatime,subvolid=0 0 0 #/dev/disk/by-label/btrfs-root /home btrfs defaults,noatime,subvol=__home-new,inode_cache,space_cache 0 0 /dev/disk/by-label/btrfs-root /home btrfs defaults,noatime,subvol=__home-new,clear_cache 0 0 /var/lib/btrfs-root/boot /boot none bind 0 0 Then I could mount the /home subvolume. I also found the corrupted file ? -????????? ? ? ? ? ? 13.4.4.40.js Whenever I try to access it I am getting Input/output error and the following error in the kernel.log Oct 10 10:38:03 yukikaze kernel: [34592.275080] parent transid verify failed on 105930436608 wanted 58565 found 134248 Oct 10 10:38:03 yukikaze kernel: [34592.275161] BUG: scheduling while atomic: ls/2545/0x00000002 Oct 10 10:38:03 yukikaze kernel: [34592.275166] Modules linked in: ipv6 loop usb_storage uas radeon snd_hda_codec_hdmi ttm snd_hda_codec_via drm_kms_helper ppdev sg snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd edac_core soundcore sp5100_tco r8169 drm firewire_ohci firewire_core i2c_algo_bit i2c_piix4 i2c_core edac_mce_amd parport_pc shpchp parport pci_hotplug pcspkr evdev mii serio_raw k10temp psmouse asus_atk0110 snd_page_alloc crc_itu_t wmi button powernow_k8 processor mperf sr_mod cdrom sd_mod pata_acpi usbhid hid ohci_hcd pata_atiixp ahci libahci libata ehci_hcd scsi_mod usbcore Oct 10 10:38:03 yukikaze kernel: [34592.275268] Pid: 2545, comm: ls Not tainted 3.0.6-aya1 #3 Oct 10 10:38:03 yukikaze kernel: [34592.275273] Call Trace: Oct 10 10:38:03 yukikaze kernel: [34592.275288] [] __schedule_bug+0x5f/0x64 Oct 10 10:38:03 yukikaze kernel: [34592.275298] [] __schedule+0x7c9/0x980 Oct 10 10:38:03 yukikaze kernel: [34592.275310] [] ? submit_bio+0x87/0x110 Oct 10 10:38:03 yukikaze kernel: [34592.275320] [] ? read_tsc+0x9/0x20 Oct 10 10:38:03 yukikaze kernel: [34592.275329] [] ? ktime_get_ts+0xad/0xe0 Oct 10 10:38:03 yukikaze kernel: [34592.275338] [] ? __lock_page+0x70/0x70 Oct 10 10:38:03 yukikaze kernel: [34592.275346] [] schedule+0x3f/0x60 Oct 10 10:38:03 yukikaze kernel: [34592.275354] [] io_schedule+0x8f/0xd0 Oct 10 10:38:03 yukikaze kernel: [34592.275362] [] sleep_on_page+0xe/0x20 Oct 10 10:38:03 yukikaze kernel: [34592.275370] [] __wait_on_bit+0x5f/0x90 Oct 10 10:38:03 yukikaze kernel: [34592.275379] [] wait_on_page_bit+0x78/0x80 Oct 10 10:38:03 yukikaze kernel: [34592.275388] [] ? autoremove_wake_function+0x40/0x40 Oct 10 10:38:03 yukikaze kernel: [34592.275397] [] read_extent_buffer_pages+0x412/0x480 Oct 10 10:38:03 yukikaze kernel: [34592.275405] [] ? verify_parent_transid+0x240/0x240 Oct 10 10:38:03 yukikaze kernel: [34592.275414] [] btree_read_extent_buffer_pages.isra.61+0x8a/0xc0 Oct 10 10:38:03 yukikaze kernel: [34592.275422] [] read_tree_block+0x41/0x60 Oct 10 10:38:03 yukikaze kernel: [34592.275431] [] read_block_for_search.isra.33+0x1fb/0x500 Oct 10 10:38:03 yukikaze kernel: [34592.275439] [] ? generic_bin_search.constprop.35+0x17d/0x1f0 Oct 10 10:38:03 yukikaze kernel: [34592.275447] [] ? bin_search+0xe4/0x130 Oct 10 10:38:03 yukikaze kernel: [34592.275454] [] btrfs_search_slot+0x358/0x900 Oct 10 10:38:03 yukikaze kernel: [34592.275464] [] btrfs_lookup_inode+0x2f/0xa0 Oct 10 10:38:03 yukikaze kernel: [34592.275473] [] btrfs_iget+0x108/0x4d0 Oct 10 10:38:03 yukikaze kernel: [34592.275482] [] ? btrfs_lookup_dir_item+0xdf/0x110 Oct 10 10:38:03 yukikaze kernel: [34592.275491] [] btrfs_lookup_dentry+0x383/0x480 Oct 10 10:38:03 yukikaze kernel: [34592.275499] [] ? kmem_cache_alloc+0x149/0x160 Oct 10 10:38:03 yukikaze kernel: [34592.275508] [] btrfs_lookup+0x16/0x30 Oct 10 10:38:03 yukikaze kernel: [34592.275515] [] d_alloc_and_lookup+0x45/0x90 Oct 10 10:38:03 yukikaze kernel: [34592.275524] [] ? d_lookup+0x35/0x60 Oct 10 10:38:03 yukikaze kernel: [34592.275531] [] do_lookup+0x29e/0x310 Oct 10 10:38:03 yukikaze kernel: [34592.275538] [] path_lookupat+0x11c/0x700 Oct 10 10:38:03 yukikaze kernel: [34592.275546] [] do_path_lookup+0x31/0xc0 Oct 10 10:38:03 yukikaze kernel: [34592.275553] [] user_path_at+0x59/0xa0 Oct 10 10:38:03 yukikaze kernel: [34592.275561] [] ? do_page_fault+0x1c0/0x4d0 Oct 10 10:38:03 yukikaze kernel: [34592.275570] [] vfs_fstatat+0x44/0x70 Oct 10 10:38:03 yukikaze kernel: [34592.275578] [] ? do_sigaction+0x12d/0x1f0 Oct 10 10:38:03 yukikaze kernel: [34592.275586] [] vfs_stat+0x1b/0x20 Oct 10 10:38:03 yukikaze kernel: [34592.275593] [] sys_newstat+0x1a/0x40 Oct 10 10:38:03 yukikaze kernel: [34592.275601] [] ? sys_rt_sigaction+0x8d/0xc0 Oct 10 10:38:03 yukikaze kernel: [34592.275610] [] ? page_fault+0x25/0x30 Oct 10 10:38:03 yukikaze kernel: [34592.275617] [] system_call_fastpath+0x16/0x1b My question - is it possible to delete this rogue file somehow or repair it? I tried to delete the directory that contained it, but got the same Input/output error. Any help is appreciated. I need to mention that I did have the very same error about a couple of months ago with about 30 files getting corrupt this way in my /home. I had to create a new subvolume for /home (__home-new) and restore the missing files from backup. When I tried to delete the corrupted subvolume it gave me a bunch of kernel errors, but when I repeated the command, it completed ok. However, on reboot the space from this subvolume was not recovered. I tried to balance the subvolume after that but after a couple of hours I am getting only the note about 22 extents in my kernel.log Oct 10 11:03:22 yukikaze kernel: [36111.396313] btrfs: found 22 extents Oct 10 11:03:27 yukikaze kernel: [36116.922236] btrfs: found 22 extents Oct 10 11:03:33 yukikaze kernel: [36122.922488] btrfs: found 22 extents and no relocation messages. So I think it go stuck ( thanks ~dima --- archlinux Linux yukikaze 3.0.6-aya1 #3 SMP PREEMPT Sat Oct 8 19:01:41 JST 2011 x86_64 AMD Athlon(tm) II X4 635 Processor AuthenticAMD GNU/Linux the latest btrfs-tools