)]}' { "commit": "f8e5f9f2ed1a383d5726d4e55a40c7e6f9bc9744", "tree": "7e83ab1405cac6b14d5cd4a91f122fa32e18776d", "parents": [ "80fbc6c5d03ba9c192f0e406ee0b6ec60711d603" ], "author": { "name": "Bryan Freed", "email": "bfreed@chromium.org", "time": "Fri Nov 11 13:05:30 2011 -0800" }, "committer": { "name": "Bryan Freed", "email": "bfreed@chromium.org", "time": "Mon Nov 14 11:19:52 2011 -0800" }, "message": "rootdev: Prevent infinite recursion when parsing /sys/block.\n\nThe mmcblk driver of the 3.0.8 kernel adds mmcblk0boot0 and mmcblk0boot1\ndirectories under /sys/block or /sys/block/mmcblk0. I have seen it both ways.\nThe device symlink in those directories points to \"../../mmcblk0\" which\npoints to the grandparent directory.\n\nWhen rootdev scans /sys/block looking for a device that matches \"/\", it\ncan fall into this loop and recurse until failure.\n\nWhile a proper fix would detect loops to prevent recursion, that adds\nconsiderable complexity to the directory scan.\nThis relatively simple solution limits recursion depth to 5 to prevent\ninfinitely looping. It will fail to find device matches beyond 5 levels\nof directories, but we are nowhere near that in today\u0027s systems. We find\nmatches at level 3 as best I can tell.\n\nBUG\u003dchromium-os:22855\nTEST\u003dRun rootdev and check for failures.\n\nChange-Id: I9ef3aa0a6d6f8143dd0b9e012ba4bb4adfa0c73b\nReviewed-on: https://gerrit.chromium.org/gerrit/11575\nReviewed-by: Will Drewry \u003cwad@chromium.org\u003e\nCommit-Ready: Bryan Freed \u003cbfreed@chromium.org\u003e\nTested-by: Bryan Freed \u003cbfreed@chromium.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "867974f50cb13f6b24033f635a9607a0b2510bad", "old_mode": 33188, "old_path": "rootdev.c", "new_id": "3162be997947c73425bb82d453ba3d88ace8a007", "new_mode": 33188, "new_path": "rootdev.c" } ] }