)]}'
{
  "commit": "62bef58a55dfa8ada2a22b2496c6340468ecd98a",
  "tree": "c621a5bddd37e100da55522c242c3b66d0277b8c",
  "parents": [
    "14b97deddf8ddecce9f35165b667c55c73e14638"
  ],
  "author": {
    "name": "Vitaly Kuznetsov",
    "email": "vkuznets@redhat.com",
    "time": "Thu Sep 17 16:01:51 2015 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Sep 17 21:16:07 2015 -0700"
  },
  "message": "lib/string_helpers.c: fix infinite loop in string_get_size()\n\nSome string_get_size() calls (e.g.:\n string_get_size(1, 512, STRING_UNITS_10, ..., ...)\n string_get_size(15, 64, STRING_UNITS_10, ..., ...)\n) result in an infinite loop. The problem is that if size is equal to\ndivisor[units]/blk_size and is smaller than divisor[units] we\u0027ll end\nup with size \u003d\u003d 0 when we start doing sf_cap calculations:\n\nFor string_get_size(1, 512, STRING_UNITS_10, ..., ...) case:\n   ...\n   remainder \u003d do_div(size, divisor[units]); -\u003e size is 0, remainder is 1\n   remainder *\u003d blk_size; -\u003e remainder is 512\n   ...\n   size *\u003d blk_size; -\u003e size is still 0\n   size +\u003d remainder / divisor[units]; -\u003e size is still 0\n\nThe caller causing the issue is sd_read_capacity(), the problem was\nnoticed on Hyper-V, such weird size was reported by host when scanning\ncollides with device removal.  This is probably a separate issue worth\nfixing, this patch is intended to prevent the library routine from\ninfinite looping.\n\nSigned-off-by: Vitaly Kuznetsov \u003cvkuznets@redhat.com\u003e\nAcked-by: James Bottomley \u003cJBottomley@Odin.com\u003e\nCc: Andy Shevchenko \u003candriy.shevchenko@linux.intel.com\u003e\nCc: Rasmus Villemoes \u003clinux@rasmusvillemoes.dk\u003e\nCc: \"K. Y. Srinivasan\" \u003ckys@microsoft.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "54036ce2e2dd0a4ab042c9c19b2d54fa41a34115",
      "old_mode": 33188,
      "old_path": "lib/string_helpers.c",
      "new_id": "5939f63d90cde79fe1e09814765539a7e43a3c28",
      "new_mode": 33188,
      "new_path": "lib/string_helpers.c"
    }
  ]
}
