Skip to content

Commit

Permalink
Btrfs: join the transaction in __btrfs_setxattr
Browse files Browse the repository at this point in the history
With selinux on we end up calling __btrfs_setxattr when we create an inode,
which calls btrfs_start_transaction().  The problem is we've already called
that in btrfs_new_inode, and in btrfs_start_transaction we end up doing a
wait_current_trans().  If btrfs-transaction has started committing it will wait
for all handles to finish, while the other process is waiting for the
transaction to commit.  This is fixed by using btrfs_join_transaction, which
won't wait for the transaction to commit.  Thanks,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Feb 4, 2009
1 parent 8c087b5 commit 8114494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int __btrfs_setxattr(struct inode *inode, const char *name,
if (!path)
return -ENOMEM;

trans = btrfs_start_transaction(root, 1);
trans = btrfs_join_transaction(root, 1);
btrfs_set_trans_block_group(trans, inode);

/* first lets see if we already have this xattr */
Expand Down

0 comments on commit 8114494

Please sign in to comment.