From patchwork Fri Dec 18 00:48:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jim owens X-Patchwork-Id: 68570 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 nBI4ixx2005715 for ; Fri, 18 Dec 2009 04:48:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755796AbZLRAsz (ORCPT ); Thu, 17 Dec 2009 19:48:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755683AbZLRAsv (ORCPT ); Thu, 17 Dec 2009 19:48:51 -0500 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:28906 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755450AbZLRAst (ORCPT ); Thu, 17 Dec 2009 19:48:49 -0500 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g5t0007.atlanta.hp.com (Postfix) with ESMTP id 71CE614428; Fri, 18 Dec 2009 00:48:48 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id 4029914014; Fri, 18 Dec 2009 00:48:48 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 18130CF002A; Thu, 17 Dec 2009 17:48:48 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VH07u+48DA3b; Thu, 17 Dec 2009 17:48:48 -0700 (MST) Received: from [192.168.0.99] (squirrel.fc.hp.com [15.11.146.57]) (Authenticated sender: owens@fc.hp.com) by ldl (Postfix) with ESMTPA id 8089DCF0007; Thu, 17 Dec 2009 17:48:47 -0700 (MST) Message-ID: <4B2AD16E.70608@hp.com> Date: Thu, 17 Dec 2009 19:48:46 -0500 From: jim owens User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: linux-btrfs CC: Chris Mason Subject: Btrfs: btrfs_discard_extent must use WRITE with btrfs_map_block. Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 86bc625..adc59fa 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1585,7 +1585,7 @@ static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, return 0; /* Tell the block device(s) that the sectors can be discarded */ - ret = btrfs_map_block(&root->fs_info->mapping_tree, READ, + ret = btrfs_map_block(&root->fs_info->mapping_tree, WRITE, bytenr, &map_length, &multi, 0); if (!ret) { struct btrfs_bio_stripe *stripe = multi->stripes;