diff options
| -rw-r--r-- | fs/btrfs/transaction.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index eb2bd826bb04..667735fb45e6 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
| @@ -122,6 +122,24 @@ loop: | |||
| 122 | cur_trans->delayed_refs.flushing = 0; | 122 | cur_trans->delayed_refs.flushing = 0; |
| 123 | cur_trans->delayed_refs.run_delayed_start = 0; | 123 | cur_trans->delayed_refs.run_delayed_start = 0; |
| 124 | cur_trans->delayed_refs.seq = 1; | 124 | cur_trans->delayed_refs.seq = 1; |
| 125 | |||
| 126 | /* | ||
| 127 | * although the tree mod log is per file system and not per transaction, | ||
| 128 | * the log must never go across transaction boundaries. | ||
| 129 | */ | ||
| 130 | smp_mb(); | ||
| 131 | if (!list_empty(&fs_info->tree_mod_seq_list)) { | ||
| 132 | printk(KERN_ERR "btrfs: tree_mod_seq_list not empty when " | ||
| 133 | "creating a fresh transaction\n"); | ||
| 134 | WARN_ON(1); | ||
| 135 | } | ||
| 136 | if (!RB_EMPTY_ROOT(&fs_info->tree_mod_log)) { | ||
| 137 | printk(KERN_ERR "btrfs: tree_mod_log rb tree not empty when " | ||
| 138 | "creating a fresh transaction\n"); | ||
| 139 | WARN_ON(1); | ||
| 140 | } | ||
| 141 | atomic_set(&fs_info->tree_mod_seq, 0); | ||
| 142 | |||
| 125 | init_waitqueue_head(&cur_trans->delayed_refs.seq_wait); | 143 | init_waitqueue_head(&cur_trans->delayed_refs.seq_wait); |
| 126 | spin_lock_init(&cur_trans->commit_lock); | 144 | spin_lock_init(&cur_trans->commit_lock); |
| 127 | spin_lock_init(&cur_trans->delayed_refs.lock); | 145 | spin_lock_init(&cur_trans->delayed_refs.lock); |
