diff mbox

Btrfs: do not mark the chunk as readonly if in degraded mode

Message ID 20100127020758.GA11767@dhcp231-156.rdu.redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Josef Bacik Jan. 27, 2010, 2:07 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3dda2ce..68fe767 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2538,6 +2538,11 @@  int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset)
 	if (!em)
 		return 1;
 
+	if (btrfs_test_opt(root, DEGRADED)) {
+		free_extent_map(em);
+		return 0;
+	}
+
 	map = (struct map_lookup *)em->bdev;
 	for (i = 0; i < map->num_stripes; i++) {
 		if (!map->stripes[i].dev->writeable) {