)]}'
{
  "commit": "aa90f3e2755e84805941bbb35f0cf30363a257f7",
  "tree": "f0f4c70aa6e323d290a476e6136233f2716bd0b2",
  "parents": [
    "58f1e938c50e73649aafe6eefc31a62417cd3b24"
  ],
  "author": {
    "name": "Josef Bacik",
    "email": "josef@toxicpanda.com",
    "time": "Mon Sep 30 11:38:48 2019 -0700"
  },
  "committer": {
    "name": "Josef Bacik",
    "email": "josef@toxicpanda.com",
    "time": "Mon Sep 30 12:40:09 2019 -0700"
  },
  "message": "btrfs: fix incorrect updating of log root tree\n\nWe\u0027ve historically had reports of being unable to mount file systems\nbecause the tree log root couldn\u0027t be read.  Usually this is the \"parent\ntransid failure\", but could be any of the related errors, including\n\"fsid mismatch\" or \"bad tree block\", depending on which block got\nallocated.\n\nThe modification of the individual log root items are serialized on the\nper-log root root_mutex.  This means that any modification to the\nper-subvol log root_item is completely protected.\n\nHowever we update the root item in the log root tree outside of the log\nroot tree log_mutex.  We do this in order to allow multiple subvolumes\nto be updated in each log transaction.\n\nThis is problematic however because when we are writing the log root\ntree out we update the super block with the _current_ log root node\ninformation.  Since these two operations happen independently of each\nother, you can end up updating the log root tree in between writing out\nthe dirty blocks and setting the super block to point at the current\nroot.\n\nThis means we\u0027ll point at the new root node that hasn\u0027t been written\nout, instead of the one we should be pointing at.  Thus whatever garbage\nor old block we end up pointing at complains when we mount the file\nsystem later and try to replay the log.\n\nFix this by copying the log\u0027s root item into a local root item copy.\nThen once we\u0027re safely under the log_root_tree-\u003elog_mutex we update the\nroot item in the log_root_tree.  This way we do not modify the\nlog_root_tree while we\u0027re committing it, fixing the problem.\n\nSigned-off-by: Josef Bacik \u003cjosef@toxicpanda.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7cac09a6f007431435c1552c9c75e18529e30a72",
      "old_mode": 33188,
      "old_path": "fs/btrfs/tree-log.c",
      "new_id": "1d7f22951ef26ac7c7f9312d5a517dbd477cdeb5",
      "new_mode": 33188,
      "new_path": "fs/btrfs/tree-log.c"
    }
  ]
}
