From patchwork Wed Jan 27 02:07:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 75379 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0R1sqNH023836 for ; Wed, 27 Jan 2010 01:54:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754215Ab0A0ByZ (ORCPT ); Tue, 26 Jan 2010 20:54:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753774Ab0A0ByU (ORCPT ); Tue, 26 Jan 2010 20:54:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58499 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942Ab0A0ByO (ORCPT ); Tue, 26 Jan 2010 20:54:14 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0R1sExX002673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Jan 2010 20:54:14 -0500 Received: from dhcp231-156.rdu.redhat.com (dhcp231-156.rdu.redhat.com [10.11.231.156]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0R1sDMX027441 for ; Tue, 26 Jan 2010 20:54:14 -0500 Date: Tue, 26 Jan 2010 21:07:59 -0500 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: do not mark the chunk as readonly if in degraded mode Message-ID: <20100127020758.GA11767@dhcp231-156.rdu.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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) {