History

hfsplus: fix issue with unzeroed unused b-tree nodes

The fsck_hfs (under MacOS X) complains about unzeroed unused b-tree nodes after deletion of folders' tree under Linux. SYMPTOMS: Running Disk Utiltiy's "Verify Disk" on "test" gives the following: Verifying volume “Test” Checking file systemChecking Journaled HFS Plus volume. Checking extents overflow file. Checking catalog file. Unused node is not erased (node = 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 source tree. 5. Unmount and boot back into OS X. 6. Open up Disk Utility and verify partition. REPRODUCIBILITY: 100% FIX: It is added code of node clearing in hfs_bnode_put() method for the case when node has flag HFS_BNODE_DELETED.

Vyacheslav Dubeyko committed 13 years ago

Commit 899bed01 parent 324ef391 file · +2 −0Browse files

Unified · Split

fs/hfsplus/bnode.c+2−0
@@ -648,6 +648,8 @@ void hfs_bnode_put(struct hfs_bnode *node) · 647 unmodified lines
648 if (test_bit(HFS_BNODE_DELETED, &node->flags)) {648 if (test_bit(HFS_BNODE_DELETED, &node->flags)) {
649 hfs_bnode_unhash(node);649 hfs_bnode_unhash(node);
650 spin_unlock(&tree->hash_lock);650 spin_unlock(&tree->hash_lock);
651 hfs_bnode_clear(node, 0,
652 PAGE_CACHE_SIZE * tree->pages_per_bnode);
651 hfs_bmap_free(node);653 hfs_bmap_free(node);
652 hfs_bnode_free(node);654 hfs_bnode_free(node);
653 return;655 return;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t