diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/async-thread.c | 3 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index cb97174e2366..0b394580d860 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c | |||
@@ -563,8 +563,8 @@ static struct btrfs_worker_thread *find_worker(struct btrfs_workers *workers) | |||
563 | struct list_head *fallback; | 563 | struct list_head *fallback; |
564 | int ret; | 564 | int ret; |
565 | 565 | ||
566 | again: | ||
567 | spin_lock_irqsave(&workers->lock, flags); | 566 | spin_lock_irqsave(&workers->lock, flags); |
567 | again: | ||
568 | worker = next_worker(workers); | 568 | worker = next_worker(workers); |
569 | 569 | ||
570 | if (!worker) { | 570 | if (!worker) { |
@@ -579,6 +579,7 @@ again: | |||
579 | spin_unlock_irqrestore(&workers->lock, flags); | 579 | spin_unlock_irqrestore(&workers->lock, flags); |
580 | /* we're below the limit, start another worker */ | 580 | /* we're below the limit, start another worker */ |
581 | ret = __btrfs_start_workers(workers); | 581 | ret = __btrfs_start_workers(workers); |
582 | spin_lock_irqsave(&workers->lock, flags); | ||
582 | if (ret) | 583 | if (ret) |
583 | goto fallback; | 584 | goto fallback; |
584 | goto again; | 585 | goto again; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0a6b928813a4..fd1a06df5bc6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4590,10 +4590,6 @@ static int btrfs_add_nondir(struct btrfs_trans_handle *trans, | |||
4590 | int err = btrfs_add_link(trans, dir, inode, | 4590 | int err = btrfs_add_link(trans, dir, inode, |
4591 | dentry->d_name.name, dentry->d_name.len, | 4591 | dentry->d_name.name, dentry->d_name.len, |
4592 | backref, index); | 4592 | backref, index); |
4593 | if (!err) { | ||
4594 | d_instantiate(dentry, inode); | ||
4595 | return 0; | ||
4596 | } | ||
4597 | if (err > 0) | 4593 | if (err > 0) |
4598 | err = -EEXIST; | 4594 | err = -EEXIST; |
4599 | return err; | 4595 | return err; |
@@ -4655,6 +4651,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, | |||
4655 | else { | 4651 | else { |
4656 | init_special_inode(inode, inode->i_mode, rdev); | 4652 | init_special_inode(inode, inode->i_mode, rdev); |
4657 | btrfs_update_inode(trans, root, inode); | 4653 | btrfs_update_inode(trans, root, inode); |
4654 | d_instantiate(dentry, inode); | ||
4658 | } | 4655 | } |
4659 | out_unlock: | 4656 | out_unlock: |
4660 | nr = trans->blocks_used; | 4657 | nr = trans->blocks_used; |
@@ -4722,6 +4719,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, | |||
4722 | inode->i_mapping->a_ops = &btrfs_aops; | 4719 | inode->i_mapping->a_ops = &btrfs_aops; |
4723 | inode->i_mapping->backing_dev_info = &root->fs_info->bdi; | 4720 | inode->i_mapping->backing_dev_info = &root->fs_info->bdi; |
4724 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; | 4721 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; |
4722 | d_instantiate(dentry, inode); | ||
4725 | } | 4723 | } |
4726 | out_unlock: | 4724 | out_unlock: |
4727 | nr = trans->blocks_used; | 4725 | nr = trans->blocks_used; |
@@ -4779,6 +4777,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
4779 | struct dentry *parent = dentry->d_parent; | 4777 | struct dentry *parent = dentry->d_parent; |
4780 | err = btrfs_update_inode(trans, root, inode); | 4778 | err = btrfs_update_inode(trans, root, inode); |
4781 | BUG_ON(err); | 4779 | BUG_ON(err); |
4780 | d_instantiate(dentry, inode); | ||
4782 | btrfs_log_new_name(trans, inode, NULL, parent); | 4781 | btrfs_log_new_name(trans, inode, NULL, parent); |
4783 | } | 4782 | } |
4784 | 4783 | ||
@@ -7245,6 +7244,8 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, | |||
7245 | drop_inode = 1; | 7244 | drop_inode = 1; |
7246 | 7245 | ||
7247 | out_unlock: | 7246 | out_unlock: |
7247 | if (!err) | ||
7248 | d_instantiate(dentry, inode); | ||
7248 | nr = trans->blocks_used; | 7249 | nr = trans->blocks_used; |
7249 | btrfs_end_transaction_throttle(trans, root); | 7250 | btrfs_end_transaction_throttle(trans, root); |
7250 | if (drop_inode) { | 7251 | if (drop_inode) { |