diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-02-13 16:09:14 (GMT) |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 17:59:57 (GMT) |
commit | 569e0f358c0c37f6733702d4a5d2c412860f7169 (patch) | |
tree | 8ab0ece9bd2716da66a43406628f6f5176604817 /fs/btrfs/transaction.h | |
parent | dde5740fdd6175fc95aecf4ccc7856fbbad9b44e (diff) | |
download | linux-fsl-qoriq-569e0f358c0c37f6733702d4a5d2c412860f7169.tar.xz |
Btrfs: place ordered operations on a per transaction list
Miao made the ordered operations stuff run async, which introduced a
deadlock where we could get somebody (sync) racing in and committing the
transaction while a commit was already happening. The new committer would
try and flush ordered operations which would hang waiting for the commit to
finish because it is done asynchronously and no longer inherits the callers
trans handle. To fix this we need to make the ordered operations list a per
transaction list. We can get new inodes added to the ordered operation list
by truncating them and then having another process writing to them, so this
makes it so that anybody trying to add an ordered operation _must_ start a
transaction in order to add itself to the list, which will keep new inodes
from getting added to the ordered operations list after we start committing.
This should fix the deadlock and also keeps us from doing a lot more work
than we need to during commit. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r-- | fs/btrfs/transaction.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index 4662821..3f772fd 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h @@ -43,6 +43,7 @@ struct btrfs_transaction { wait_queue_head_t writer_wait; wait_queue_head_t commit_wait; struct list_head pending_snapshots; + struct list_head ordered_operations; struct btrfs_delayed_ref_root delayed_refs; int aborted; }; |