kernel-ark/fs/hfsplus
Sergei Antonov 2cd282a1bc 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
899bed05e9 ("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 <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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-06-06 16:08:10 -07:00
..
acl.h hfsplus: use generic posix ACL infrastructure 2014-01-25 23:58:20 -05:00
attributes.c hfsplus: remove unused routine hfsplus_attr_build_key_uni 2014-06-06 16:08:09 -07:00
bfind.c hfs/hfsplus: convert printks to pr_<level> 2013-04-30 17:04:05 -07:00
bitmap.c hfsplus: remove duplicated message prefix in hfsplus_block_free() 2013-04-30 17:04:05 -07:00
bnode.c hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
brec.c hfs/hfsplus: convert printks to pr_<level> 2013-04-30 17:04:05 -07:00
btree.c hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
catalog.c hfsplus: add HFSX subfolder count support 2014-03-10 17:26:21 -07:00
dir.c hfsplus: emit proper file type from readdir 2014-06-06 16:08:09 -07:00
extents.c hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
hfsplus_fs.h hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
hfsplus_raw.h hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
inode.c hfsplus: add HFSX subfolder count support 2014-03-10 17:26:21 -07:00
ioctl.c hfsplus: add support of manipulation by attributes file 2013-02-27 19:10:10 -08:00
Kconfig hfsplus: add necessary declarations for POSIX ACLs support 2013-09-11 15:59:00 -07:00
Makefile hfsplus: integrate POSIX ACLs support into driver 2013-09-11 15:59:01 -07:00
options.c fs/hfsplus/options.c: replace seq_printf by seq_puts 2014-06-06 16:08:10 -07:00
part_tbl.c hfsplus: ensure bio requests are not smaller than the hardware sectors 2011-07-22 16:37:44 +02:00
posix_acl.c hfsplus: use generic posix ACL infrastructure 2014-01-25 23:58:20 -05:00
super.c Major changes for 3.14 include support for the newly added ZERO_RANGE 2014-04-04 15:39:39 -07:00
tables.c
unicode.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
wrapper.c fs/hfsplus/wrapper.c: replace min/casting by min_t 2014-06-06 16:08:10 -07:00
xattr_security.c hfsplus: correct usage of HFSPLUS_ATTR_MAX_STRLEN for non-English attributes 2014-06-06 16:08:09 -07:00
xattr_trusted.c hfsplus: correct usage of HFSPLUS_ATTR_MAX_STRLEN for non-English attributes 2014-06-06 16:08:09 -07:00
xattr_user.c hfsplus: correct usage of HFSPLUS_ATTR_MAX_STRLEN for non-English attributes 2014-06-06 16:08:09 -07:00
xattr.c hfsplus: fix "unused node is not erased" error 2014-06-06 16:08:10 -07:00
xattr.h hfsplus: use xattr handlers for removexattr 2014-01-31 14:44:39 -05:00