From: Sergei Antonov Date: Fri, 6 Jun 2014 21:36:28 +0000 (-0700) Subject: hfsplus: fix "unused node is not erased" error X-Git-Tag: omap-for-v3.16/fixes-against-rc1~91^2~4^2~118 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cd282a1bc6b9d111b8beee63bea0af735a8a1aa;p=pandora-kernel.git hfsplus: fix "unused node is not erased" error Zero newly allocated extents in the catalog tree if volume attributes tell us to. Not doing so we risk getting the "unused node is not erased" error. See kHFSUnusedNodeFix flag in Apple's source code for reference. There was a previous commit clearing the node when it is freed: commit 899bed05e9f6 ("hfsplus: fix issue with unzeroed unused b-tree nodes"). But it did not handle newly allocated extents (this patch fixes it). And it zeroed nodes in all trees unconditionally which is an overkill. This patch adds a condition and also switches to 'tree->node_size' as a simpler method of getting the length to zero. Signed-off-by: Sergei Antonov Cc: Anton Altaparmakov Cc: Al Viro Cc: Christoph Hellwig Cc: Vyacheslav Dubeyko Cc: Hin-Tak Leung Cc: Kyle Laracey Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed