kernel BUG when mounting btrfs filesystem from read-only (R/O) media

Bug #816770 reported by shiftyphil
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linux
Fix Released
Undecided
Unassigned
linux (Debian)
Fix Released
Unknown
linux (Ubuntu)
Fix Released
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-3.0.0-7-generic 3.0.0-7.8
ProcVersionSignature: Ubuntu 3.0.0-7.8-generic 3.0.0
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/controlC1: phil 4897 F.... pulseaudio
 /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,1025011f,00100003 HDA:14f12c06,10250093,00100000'
   Controls : 19
   Simple ctrls : 13
Card1.Amixer.info:
 Card hw:1 'Set'/'C-Media USB Headphone Set at usb-0000:00:1d.7-3.6.4, full speed'
   Mixer name : 'USB Mixer'
   Components : 'USB0d8c:000c'
   Controls : 7
   Simple ctrls : 3
Date: Wed Jul 27 12:13:55 2011
Failure: oops
HibernationDevice: RESUME=UUID=4e603944-5cd0-47a1-b5e4-b7b1b520d080
MachineType: Acer TravelMate 7720
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.0.0-7-generic root=/dev/mapper/vgsystem-root ro rootfstype=ext4 quiet splash vt.handoff=7
RelatedPackageVersions: kerneloops-daemon 0.12+git20090217-1ubuntu13
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.asset.tag: None
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrV1.35:bd07/03/2008:svnAcer:pnTravelMate7720:pvr0100:rvnAcer:rnTangiz:rvrRev:cvnAcer:ct10:cvrN/A:
dmi.product.name: TravelMate 7720
dmi.product.version: 0100
dmi.sys.vendor: Acer

Revision history for this message
shiftyphil (phil-higgins) wrote :
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
tags: added: oneiric
Revision history for this message
Andy Whitcroft (apw) wrote :

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.

Changed in linux (Ubuntu):
status: Confirmed → Triaged
summary: - kernel BUG when accessing btrfs filesystem
+ kernel BUG when mounting btrfs filesystem from R/O media
Andy Whitcroft (apw)
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Triaged → In Progress
assignee: nobody → Andy Whitcroft (apw)
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
Revision history for this message
Andy Whitcroft (apw) wrote :

Preliminary patches sent upstream for review.

Revision history for this message
Lapse of Reason (lapseofreason0) wrote :

Here is a link to the upstream patch, in case anybody wants to try it out:

http://thread.gmane.org/gmane.comp.file-systems.btrfs/12319

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/$VERSION/updates/
- run depmod
- reload the module

Revision history for this message
Lapse of Reason (lapseofreason0) wrote :

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.

Gary M (garym)
Changed in linux:
status: New → Fix Released
Changed in linux (Debian):
status: Unknown → Fix Released
Revision history for this message
Andy Whitcroft (apw) wrote :

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 b772a86ea6d932ac29d5e50e67c977653c832f8a
  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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.