{"push_id":635454920,"size":1,"distinct_size":1,"ref":"refs/heads/lollipop","head":"052f04ff7dd1236fbd70c3f267006f64a3bea130","before":"19435f5a4aa9783eb480a0c62b96ba301ba952e2","commits":[{"sha":"052f04ff7dd1236fbd70c3f267006f64a3bea130","author":{"email":"0445d8d496ca2329e0591a9015f1896561acd988@gmail.com","name":"Sergei Antonov"},"message":"hfsplus: fix B-tree corruption after insertion at position 0\n\ncommit 98cf21c61a7f5419d82f847c4d77bf6e96a76f5f upstream.\n\nFix B-tree corruption when a new record is inserted at position 0 in the\nnode in hfs_brec_insert().  In this case a hfs_brec_update_parent() is\ncalled to update the parent index node (if exists) and it is passed\nhfs_find_data with a search_key containing a newly inserted key instead\nof the key to be updated.  This results in an inconsistent index node.\nThe bug reproduces on my machine after an extents overflow record for\nthe catalog file (CNID=4) is inserted into the extents overflow B-tree.\nBecause of a low (reserved) value of CNID=4, it has to become the first\nrecord in the first leaf node.\n\nThe resulting first leaf node is correct:\n\n  ----------------------------------------------------\n  | key0.CNID=4 | key1.CNID=123 | key2.CNID=456, ... |\n  ----------------------------------------------------\n\nBut the parent index key0 still contains the previous key CNID=123:\n\n  -----------------------\n  | key0.CNID=123 | ... |\n  -----------------------\n\nA change in hfs_brec_insert() makes hfs_brec_update_parent() work\ncorrectly by preventing it from getting fd->record=-1 value from\n__hfs_brec_find().\n\nAlong the way, I removed duplicate code with unification of the if\ncondition.  The resulting code is equivalent to the original code\nbecause node is never 0.\n\nAlso hfs_brec_update_parent() will now return an error after getting a\nnegative fd->record value.  However, the return value of\nhfs_brec_update_parent() is not checked anywhere in the file and I'm\nleaving it unchanged by this patch.  brec.c lacks error checking after\nsome other calls too, but this issue is of less importance than the one\nbeing fixed by this patch.\n\nChange-Id: Ie3fc6f998f8ce54b751de67e81af90d2eab3a9bf\nSigned-off-by: Sergei Antonov <saproj@gmail.com>\nCc: Joe Perches <joe@perches.com>\nReviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com>\nAcked-by: Hin-Tak Leung <htl10@users.sourceforge.net>\nCc: Anton Altaparmakov <aia21@cam.ac.uk>\nCc: Al Viro <viro@zeniv.linux.org.uk>\nCc: Christoph Hellwig <hch@infradead.org>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>","distinct":true,"url":"https://api.github.com/repos/DirtyUnicorns/android_kernel_htc_flounder/commits/052f04ff7dd1236fbd70c3f267006f64a3bea130"}]}