From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: [PATCH] hfsplus: fix issue with unzeroed unused b-tree nodes Date: Tue, 12 Feb 2013 10:35:05 +0400 Message-ID: <1360650905.2581.3.camel@slavad-ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Kyle Laracey , Hin-Tak Leung To: linux-fsdevel@vger.kernel.org, Andrew Morton , Christoph Hellwig , Al Viro Return-path: Received: from oproxy9.bluehost.com ([69.89.24.6]:49124 "HELO oproxy9.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753275Ab3BLGfa (ORCPT ); Tue, 12 Feb 2013 01:35:30 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: =46rom: Vyacheslav Dubeyko Subject: [PATCH] hfsplus: fix issue with unzeroed unused b-tree nodes The fsck_hfs (under MacOS X) complains about unzeroed unused b-tree nod= es after deletion of folders' tree under Linux. SYMPTOMS: Running Disk Utiltiy's "Verify Disk" on "test" gives the following: Verifying volume =E2=80=9CTest=E2=80=9D Checking file systemChecking Journaled HFS Plus volume. Checking extents overflow file. Checking catalog file. Unused node is not erased (node =3D 3111) Checking multi-linked files. Checking catalog hierarchy. Checking extended attributes file. Checking volume bitmap. Checking volume information. The volume Test was found corrupt and needs to be repaired. Error: This disk needs to be repaired. Click Repair Disk. REPRODUCING PATH: 1. Prepare HFS+ (non-case sensitive) partition (for example, 5GB) under= MacOS X. 2. Copy linux kernel source tree (for example, 3.7-rc6 version) on this= partition under MacOS X. 3. Then switch to Linux and mount this prepared partition. 4. Execute `sudo rm -r` under prepared directory with linux kernel sour= ce tree. 5. Unmount and boot back into OS X. 6. Open up Disk Utility and verify partition. REPRODUCIBILITY: 100% =46IX: It is added code of node clearing in hfs_bnode_put() method for the cas= e when node has flag HFS_BNODE_DELETED. Reported-by: Kyle Laracey Signed-off-by: Vyacheslav Dubeyko Tested-by: Vyacheslav Dubeyko --- fs/hfsplus/bnode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index 1c42cc5..45d7400 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c @@ -646,6 +646,8 @@ void hfs_bnode_put(struct hfs_bnode *node) if (test_bit(HFS_BNODE_DELETED, &node->flags)) { hfs_bnode_unhash(node); spin_unlock(&tree->hash_lock); + hfs_bnode_clear(node, 0, + PAGE_CACHE_SIZE * tree->pages_per_bnode); hfs_bmap_free(node); hfs_bnode_free(node); return; --=20 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html