)]}'
{
  "commit": "088d8e5ff9e095262d67ca79ee790bb001b51611",
  "tree": "60fcb43734bbe75bc3e6d3e25509904a4a5714ec",
  "parents": [
    "222989b9a850107fe99a5fbd693641566abbbae0"
  ],
  "author": {
    "name": "Josef Bacik",
    "email": "josef@redhat.com",
    "time": "Fri Nov 04 19:56:02 2011 -0400"
  },
  "committer": {
    "name": "Chris Mason",
    "email": "chris.mason@oracle.com",
    "time": "Fri Nov 04 19:56:02 2011 -0400"
  },
  "message": "Btrfs: fix delayed insertion reservation\n\nWe all keep getting those stupid warnings from use_block_rsv when running\nstress.sh, and it\u0027s because the delayed insertion stuff is being stupid.  It\u0027s\nnot the delayed insertion stuffs fault, it\u0027s all just stupid.  When marking an\ninode dirty for oh say updating the time on it, we just do a\nbtrfs_join_transaction, which doesn\u0027t reserve any space.  This is stupid because\nwe\u0027re going to have to have space reserve to make this change, but we do it\nbecause it\u0027s fast because chances are we\u0027re going to call it over and over again\nand it doesn\u0027t matter.  Well thanks to the delayed insertion stuff this is\nmostly the case, so we do actually need to make this reservation.  So if\ntrans-\u003ebytes_reserved is 0 then try to do a normal reservation.  If not return\nENOSPC which will make the btrfs_dirty_inode start a proper transaction which\nwill let it do the whole ENOSPC dance and reserve enough space for the delayed\ninsertion to steal the reservation from the transaction.\n\nThe other stupid thing we do is not reserve space for the inode when writing to\nthe thing.  Usually this is ok since we have to update the time so we\u0027d have\nalready done all this work before we get to the endio stuff, so it doesn\u0027t\nmatter.  But this is stupid because we could write the data after the\ntransaction commits where we changed the mtime of the inode so we have to cow\nall the way down to the inode anyway.  This used to be masked by the delalloc\nreservation stuff, but because we delay the update it doesn\u0027t get masked in this\ncase.  So again the delayed insertion stuff bites us in the ass.  So if our\ntrans-\u003eblock_rsv is delalloc, just steal the reservation from the delalloc\nreserve.  Hopefully this won\u0027t bite us in the ass, but I\u0027ve said that before.\n\nWith this patch stress.sh no longer spits out those stupid warnings (famous last\nwords).  Thanks,\n\nSigned-off-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5a14ab1161a058060720ef6291cf498948714342",
      "old_mode": 33188,
      "old_path": "fs/btrfs/ctree.h",
      "new_id": "346ad08917f241cf591879080ae8d823ec4c5a5f",
      "new_mode": 33188,
      "new_path": "fs/btrfs/ctree.h"
    },
    {
      "type": "modify",
      "old_id": "fc4026af72901f349f79dd5ed9d426f7bd8730a5",
      "old_mode": 33188,
      "old_path": "fs/btrfs/delayed-inode.c",
      "new_id": "bbe8496d5339f24a5939ceb32778338f06869a49",
      "new_mode": 33188,
      "new_path": "fs/btrfs/delayed-inode.c"
    },
    {
      "type": "modify",
      "old_id": "ffac4b52d4bc57625812100c9f9707ab2ebb11e0",
      "old_mode": 33188,
      "old_path": "fs/btrfs/extent-tree.c",
      "new_id": "1311beba1432159325a7b018d0a170130170f937",
      "new_mode": 33188,
      "new_path": "fs/btrfs/extent-tree.c"
    }
  ]
}
