diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-06-17 14:16:13 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-06-17 14:16:13 -0400 |
commit | e038dca803423bb7a3fa9a162b7dcc225efe9bf9 (patch) | |
tree | efd5d76b77f21b4a9e570f2cb5bed9f95970f7a0 /fs/btrfs | |
parent | 7585717f304f5ed005cc4ad933a69aab3efbd136 (diff) | |
parent | ed0ca14021e5ae3147602128641aa7f742ab227c (diff) |
Merge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-work into for-linus
Conflicts:
fs/btrfs/transaction.c
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 1 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/btrfs/transaction.c | 14 |
3 files changed, 14 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c15636b17874..5813dec5101c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3076,6 +3076,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, | |||
3076 | ret = btrfs_update_inode(trans, root, dir); | 3076 | ret = btrfs_update_inode(trans, root, dir); |
3077 | BUG_ON(ret); | 3077 | BUG_ON(ret); |
3078 | 3078 | ||
3079 | btrfs_free_path(path); | ||
3079 | return 0; | 3080 | return 0; |
3080 | } | 3081 | } |
3081 | 3082 | ||
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b793d112d1f6..a3c4751e07db 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -482,8 +482,10 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, | |||
482 | ret = btrfs_snap_reserve_metadata(trans, pending_snapshot); | 482 | ret = btrfs_snap_reserve_metadata(trans, pending_snapshot); |
483 | BUG_ON(ret); | 483 | BUG_ON(ret); |
484 | 484 | ||
485 | spin_lock(&root->fs_info->trans_lock); | ||
485 | list_add(&pending_snapshot->list, | 486 | list_add(&pending_snapshot->list, |
486 | &trans->transaction->pending_snapshots); | 487 | &trans->transaction->pending_snapshots); |
488 | spin_unlock(&root->fs_info->trans_lock); | ||
487 | if (async_transid) { | 489 | if (async_transid) { |
488 | *async_transid = trans->transid; | 490 | *async_transid = trans->transid; |
489 | ret = btrfs_commit_transaction_async(trans, | 491 | ret = btrfs_commit_transaction_async(trans, |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 833996a0c628..c073d85e14f3 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1298,13 +1298,21 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1298 | schedule_timeout(1); | 1298 | schedule_timeout(1); |
1299 | 1299 | ||
1300 | finish_wait(&cur_trans->writer_wait, &wait); | 1300 | finish_wait(&cur_trans->writer_wait, &wait); |
1301 | spin_lock(&root->fs_info->trans_lock); | ||
1302 | root->fs_info->trans_no_join = 1; | ||
1303 | spin_unlock(&root->fs_info->trans_lock); | ||
1304 | } while (atomic_read(&cur_trans->num_writers) > 1 || | 1301 | } while (atomic_read(&cur_trans->num_writers) > 1 || |
1305 | (should_grow && cur_trans->num_joined != joined)); | 1302 | (should_grow && cur_trans->num_joined != joined)); |
1306 | 1303 | ||
1307 | /* | 1304 | /* |
1305 | * Ok now we need to make sure to block out any other joins while we | ||
1306 | * commit the transaction. We could have started a join before setting | ||
1307 | * no_join so make sure to wait for num_writers to == 1 again. | ||
1308 | */ | ||
1309 | spin_lock(&root->fs_info->trans_lock); | ||
1310 | root->fs_info->trans_no_join = 1; | ||
1311 | spin_unlock(&root->fs_info->trans_lock); | ||
1312 | wait_event(cur_trans->writer_wait, | ||
1313 | atomic_read(&cur_trans->num_writers) == 1); | ||
1314 | |||
1315 | /* | ||
1308 | * the reloc mutex makes sure that we stop | 1316 | * the reloc mutex makes sure that we stop |
1309 | * the balancing code from coming in and moving | 1317 | * the balancing code from coming in and moving |
1310 | * extents around in the middle of the commit | 1318 | * extents around in the middle of the commit |