diff options
| -rw-r--r-- | fs/btrfs/tree-log.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 332ec35d2c08..d81cda2e077c 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
| @@ -158,6 +158,19 @@ static int btrfs_add_log_tree(struct btrfs_trans_handle *trans, | |||
| 158 | */ | 158 | */ |
| 159 | new_root->ref_cows = 0; | 159 | new_root->ref_cows = 0; |
| 160 | new_root->last_trans = trans->transid; | 160 | new_root->last_trans = trans->transid; |
| 161 | |||
| 162 | /* | ||
| 163 | * we need to make sure the root block for this new tree | ||
| 164 | * is marked as dirty in the dirty_log_pages tree. This | ||
| 165 | * is how it gets flushed down to disk at tree log commit time. | ||
| 166 | * | ||
| 167 | * the tree logging mutex keeps others from coming in and changing | ||
| 168 | * the new_root->node, so we can safely access it here | ||
| 169 | */ | ||
| 170 | set_extent_dirty(&new_root->dirty_log_pages, new_root->node->start, | ||
| 171 | new_root->node->start + new_root->node->len - 1, | ||
| 172 | GFP_NOFS); | ||
| 173 | |||
| 161 | fail: | 174 | fail: |
| 162 | return ret; | 175 | return ret; |
| 163 | } | 176 | } |
