]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hfsplus: fix "unused node is not erased" error
authorSergei Antonov <saproj@gmail.com>
Thu, 22 May 2014 00:43:59 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:59 +0000 (10:43 +1000)
commit15065302969dc108e6a3331fde60b0518ec4cfdb
treebc9f5cfdfb26b58086e3b37ad298870eef20dc39
parentfaa7c21459067de9686cdd62cfb47685bc5c60fc
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 899bed05e9f6bbb21776f9ebd88f5631987f987a
  Author: Vyacheslav Dubeyko <slava@dubeyko.com>
  Date:   Wed Feb 27 17:03:06 2013 -0800
  hfsplus: fix issue with unzeroed unused b-tree nodes
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 <saproj@gmail.com>
Cc: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Kyle Laracey <kalaracey@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/hfsplus/bnode.c
fs/hfsplus/btree.c
fs/hfsplus/extents.c
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/hfsplus_raw.h
fs/hfsplus/xattr.c