]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/btrfs/tree-log.c
Btrfs: explicitly mark the tree log root for writeback
[linux-2.6-omap-h63xx.git] / fs / btrfs / tree-log.c
index 332ec35d2c0858351aa1d7937d2576e55bc1ad99..d81cda2e077c9b3c4685d26a55057826d0c06b2d 100644 (file)
@@ -158,6 +158,19 @@ static int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
         */
        new_root->ref_cows = 0;
        new_root->last_trans = trans->transid;
+
+       /*
+        * we need to make sure the root block for this new tree
+        * is marked as dirty in the dirty_log_pages tree.  This
+        * is how it gets flushed down to disk at tree log commit time.
+        *
+        * the tree logging mutex keeps others from coming in and changing
+        * the new_root->node, so we can safely access it here
+        */
+       set_extent_dirty(&new_root->dirty_log_pages, new_root->node->start,
+                        new_root->node->start + new_root->node->len - 1,
+                        GFP_NOFS);
+
 fail:
        return ret;
 }