kernel BUG when mounting btrfs filesystem from read-only (R/O) media
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Linux |
Fix Released
|
Undecided
|
Unassigned | |
| | linux (Debian) |
Fix Released
|
Unknown
|
||
| | linux (Ubuntu) |
Medium
|
Andy Whitcroft | ||
Bug Description
Inserted an SD card that contained a btrfs filesystem and tried to open using nautilus.
ProblemType: KernelOops
DistroRelease: Ubuntu 11.10
Package: linux-image-
ProcVersionSign
Uname: Linux 3.0.0-7-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
Annotation: Your system might become unstable now and might need to be restarted.
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
/dev/snd/seq: timidity 4688 F.... timidity
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
Card hw:0 'Intel'/'HDA Intel at 0xfc300000 irq 47'
Mixer name : 'Realtek ALC268'
Components : 'HDA:10ec0268,
Controls : 19
Simple ctrls : 13
Card1.Amixer.info:
Card hw:1 'Set'/'C-Media USB Headphone Set at usb-0000:
Mixer name : 'USB Mixer'
Components : 'USB0d8c:000c'
Controls : 7
Simple ctrls : 3
Date: Wed Jul 27 12:13:55 2011
Failure: oops
HibernationDevice: RESUME=
MachineType: Acer TravelMate 7720
PccardctlIdent:
Socket 0:
no product info available
PccardctlStatus:
Socket 0:
no card
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
SourcePackage: linux
Title: ] ------------[ cut here ]------------
UpgradeStatus: Upgraded to oneiric on 2011-07-17 (10 days ago)
dmi.bios.date: 07/03/2008
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: V1.35
dmi.board.name: Tangiz
dmi.board.vendor: Acer
dmi.board.version: Rev
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: TravelMate 7720
dmi.product.
dmi.sys.vendor: Acer
| shiftyphil (phil-higgins) wrote : | #1 |
| Changed in linux (Ubuntu): | |
| status: | New → Confirmed |
| tags: | added: oneiric |
| Andy Whitcroft (apw) wrote : | #2 |
| Changed in linux (Ubuntu): | |
| status: | Confirmed → Triaged |
| summary: |
- kernel BUG when accessing btrfs filesystem + kernel BUG when mounting btrfs filesystem from R/O media |
| Changed in linux (Ubuntu): | |
| importance: | Undecided → Medium |
| status: | Triaged → In Progress |
| assignee: | nobody → Andy Whitcroft (apw) |
| summary: |
- kernel BUG when mounting btrfs filesystem from R/O media + kernel BUG when mounting btrfs filesystem from read-only (R/O) media |
| tags: |
added: kernel-driver-btrfs removed: oneirickernel-driver-btrfs |
| Andy Whitcroft (apw) wrote : | #3 |
Preliminary patches sent upstream for review.
| Lapse of Reason (lapseofreason0) wrote : | #4 |
Here is a link to the upstream patch, in case anybody wants to try it out:
http://
A quick test reveals that it does fix this bug, I haven't done any further testing though.
Be careful when trying out patches on filesystem drivers, but for anyone willing to take the risk here is a quick rundown of how to rebuild the btrfs kernel module:
- unpack the kernel source (from the kernel-source package) and copy the header files (from the kernel-headers package) into the same tree
- apply the patch or make any other changes you want
- run make M=fs/btrfs (works for any other module directory too)
- copy the compiled module to /lib/modules/
- run depmod
- reload the module
| Lapse of Reason (lapseofreason0) wrote : | #5 |
The patch I mentioned in the previous post is now in the default kernel for Ubuntu 12.04, which fixes the problem for me. Unless anyone experiences any more problems I think this bug can be marked as resolved.
| Changed in linux: | |
| status: | New → Fix Released |
| Changed in linux (Debian): | |
| status: | Unknown → Fix Released |
| Andy Whitcroft (apw) wrote : | #6 |
This was fixed by the commit below which was commited in v3.2-rc4, this is therefore fixed for precise and later at the very least:
commit b772a86ea6d932a
Author: Li Zefan <email address hidden>
Date: Mon Nov 28 16:43:00 2011 +0800
Btrfs: fix oops when calling statfs on readonly device
Closing out fixed.
| Changed in linux (Ubuntu): | |
| status: | In Progress → Fix Released |


Reproduced this by formatting an SD card as btrfs, removing and enabling the lock, and reinserting. This appears to be triggered when the SD card is physically write-protected using the lock slider.