]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: forced readonly mounts on errors
authorliubo <liubo2009@cn.fujitsu.com>
Thu, 6 Jan 2011 11:30:25 +0000 (19:30 +0800)
committerChris Mason <chris.mason@oracle.com>
Mon, 17 Jan 2011 20:13:08 +0000 (15:13 -0500)
commitea1ddcf3247d0b1d2586848e4de3b28f5db6a93c
treed934881f247484d7b6917bebc40828600bb6b76c
parentbe806c254d0244073591a3b0b2b27a4c2702fc20
Btrfs: forced readonly mounts on errors

This patch comes from "Forced readonly mounts on errors" ideas.

As we know, this is the first step in being more fault tolerant of disk
corruptions instead of just using BUG() statements.

The major content:
- add a framework for generating errors that should result in filesystems
  going readonly.
- keep FS state in disk super block.
- make sure that all of resource will be freed and released at umount time.
- make sure that fter FS is forced readonly on error, there will be no more
  disk change before FS is corrected. For this, we should stop write operation.

After this patch is applied, the conversion from BUG() to such a framework can
happen incrementally.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/super.c
fs/btrfs/transaction.c