Bug 56671

Summary: btrfs oops while defragmenting
Product: File System Reporter: Vincent Stehlé (vincent.stehle)
Component: btrfsAssignee: Josef Bacik (josef)
Status: RESOLVED CODE_FIX    
Severity: normal CC: custos.mentis, josef, vincent.stehle
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.9-rc7 Subsystem:
Regression: No Bisected commit-id:
Attachments: Photo of the kernel panic
Capture of console ramoops after reboot
full kernel log until oops

Description Vincent Stehlé 2013-04-16 07:16:16 UTC
Created attachment 98831 [details]
Photo of the kernel panic

I encounter a repeatable kernel oops while defragmenting a btrfs filesystem.

The said filesystem is on ssd, mounted with options: rw,relatime,compress=lzo,ssd_spread,discard,space_cache,autodefrag,inode_cache.

(I know defragmenting on SSD might not be of use, but still.)

Oops happens in a btrfs-endio-wri "process", at btrfs_search_old_slot.

Ramoops/pstore did not capture it, so I only have a photo for now (attached).

Best regards,

V.
Comment 1 Vincent Stehlé 2013-04-17 22:02:45 UTC
Created attachment 99061 [details]
Capture of console ramoops after reboot
Comment 2 Vincent Stehlé 2013-04-17 22:04:18 UTC
The bug happens also when defragmenting on a HDD, mounted with options: rw,relatime,compress=lzo,space_cache,autodefrag,inode_cache
Comment 3 Vincent Stehlé 2013-04-19 07:25:19 UTC
Happens also with freshly redone filesystem (mkfs.btrfs + cp -a), mounted only with relatime,compress=lzo.

Passing -f to defragment has no effect; oops still happens.
Comment 4 Josef Bacik 2013-04-30 17:13:47 UTC
Can you provide me exact commands/steps to reproduce?
Comment 5 Grzegorz Kowal 2013-05-13 08:30:11 UTC
It just happened to me too with freshly installed kernel 3.9.2.  I mounted my cellphone (Galaxy S2) and copied some photos to my home directory.  Then I've got an oops.  I couldn't even shut down the system.  I had to do hard reset.

I am attaching kernel log since the system boot until the oops happened.

With kernels 3.8.x I didn't have any problems.
Comment 6 Grzegorz Kowal 2013-05-13 08:30:44 UTC
Created attachment 101261 [details]
full kernel log until oops
Comment 7 Josef Bacik 2013-07-05 20:59:45 UTC
Fixed this in btrfs-next, please verify it fixed the problem, if it didn't please re-open this bug.