On Thu, Apr 28, 2016 at 12:29:52AM +0200, David Sterba wrote:
On Wed, Apr 27, 2016 at 09:59:38AM -0400, Chris Mason wrote:
> @@ -2854,9 +2855,16 @@ static void delayed_ref_async_start(struct btrfs_work
*work)
>
> async = container_of(work, struct async_delayed_refs, work);
>
> - trans = btrfs_join_transaction(async->root);
> + trans = btrfs_attach_transaction(async->root);
> if (IS_ERR(trans)) {
> - async->error = PTR_ERR(trans);
> + if (PTR_ERR(trans) != -ENOENT)
> + async->error = PTR_ERR(trans);
> + goto done;
> + }
This ends up deadlocking because btrfs_attach_transaction waits in ways
that join does not. The differences between these two are really
subtle, and we manage to make this mistake every year or so.
Subject: [PATCH] btrfs: fix deadlock in delayed_ref_async_start
"Btrfs: track transid for delayed ref flushing" was deadlocking on
btrfs_attach_transaction because its not safe to call from the async
delayed ref start code. This commit brings back btrfs_join_transaction
instead and checks for a blocked commit.
Signed-off-by: Josef Bacik <jba...@fb.com>
Signed-off-by: Chris Mason <c...@fb.com>
This patch seems to be an incremental but I don't see the original patch
from Josef merged anywhere (I haven't picked it to for-next yet), are
you going to commit both?
Yeah, I'll pull both in. Thanks!
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html