diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index de774580134f..258fcebc7ccf 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1169,13 +1169,17 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1169 | memcpy(new_root_item->uuid, new_uuid.b, BTRFS_UUID_SIZE); | 1169 | memcpy(new_root_item->uuid, new_uuid.b, BTRFS_UUID_SIZE); |
1170 | memcpy(new_root_item->parent_uuid, root->root_item.uuid, | 1170 | memcpy(new_root_item->parent_uuid, root->root_item.uuid, |
1171 | BTRFS_UUID_SIZE); | 1171 | BTRFS_UUID_SIZE); |
1172 | if (!(root_flags & BTRFS_ROOT_SUBVOL_RDONLY)) { | ||
1173 | memset(new_root_item->received_uuid, 0, | ||
1174 | sizeof(new_root_item->received_uuid)); | ||
1175 | memset(&new_root_item->stime, 0, sizeof(new_root_item->stime)); | ||
1176 | memset(&new_root_item->rtime, 0, sizeof(new_root_item->rtime)); | ||
1177 | btrfs_set_root_stransid(new_root_item, 0); | ||
1178 | btrfs_set_root_rtransid(new_root_item, 0); | ||
1179 | } | ||
1172 | new_root_item->otime.sec = cpu_to_le64(cur_time.tv_sec); | 1180 | new_root_item->otime.sec = cpu_to_le64(cur_time.tv_sec); |
1173 | new_root_item->otime.nsec = cpu_to_le32(cur_time.tv_nsec); | 1181 | new_root_item->otime.nsec = cpu_to_le32(cur_time.tv_nsec); |
1174 | btrfs_set_root_otransid(new_root_item, trans->transid); | 1182 | btrfs_set_root_otransid(new_root_item, trans->transid); |
1175 | memset(&new_root_item->stime, 0, sizeof(new_root_item->stime)); | ||
1176 | memset(&new_root_item->rtime, 0, sizeof(new_root_item->rtime)); | ||
1177 | btrfs_set_root_stransid(new_root_item, 0); | ||
1178 | btrfs_set_root_rtransid(new_root_item, 0); | ||
1179 | 1183 | ||
1180 | old = btrfs_lock_root_node(root); | 1184 | old = btrfs_lock_root_node(root); |
1181 | ret = btrfs_cow_block(trans, root, old, NULL, 0, &old); | 1185 | ret = btrfs_cow_block(trans, root, old, NULL, 0, &old); |