Bug 9204 - unlink broken in hfsplus - hard links
Summary: unlink broken in hfsplus - hard links
Status: CLOSED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: HFS/HFSPLUS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Roman Zippel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-21 09:14 UTC by till busch
Modified: 2008-08-13 01:56 UTC (History)
0 users

See Also:
Kernel Version: 2.6.22
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description till busch 2007-10-21 09:14:13 UTC
Most recent kernel where this bug did not occur:
Distribution: kubuntu 7.10 gutsy
Hardware Environment: MacBookPro 3.1
Software Environment: /home partition shared with OSX
Problem Description:


i'm using hfsplus for my /home (it is shared with osx). i'm having problems with hard links on hfsplus.
the link count for a file with hard links drops from n to 0 when removing one linked file.

Steps to reproduce:

install diskdev-cmds from:
 http://gentoo.osuosl.org/distfiles/diskdev_cmds-332.14.tar.gz
 http://gentoo.osuosl.org/distfiles/diskdev_cmds-332.14.patch.bz2

 make -f Makefile.lnx
interesting binaries are in newfs_hfs.tproj/ and fsck_hfs.tproj/

create a filesystem:
 dd if=/dev/zero of=/tmp/hfsplus bs=1M count=2
 newfs_hfs /tmp/hfsplus
 mkdir /tmp/mnt
 mount -oloop /tmp/hfsplus /tmp/mnt
 cd /tmp/mnt
 echo foo > foo
 ln foo foo1
 ln foo foo2
 ln foo foo3

# now check the link count:
 ls -laFi
# it is ok

# now unlink foo3
 rm foo3
# check link count again
 ls -laFi
# link count is down to 0
Comment 1 till busch 2008-08-13 01:56:08 UTC
fixed as of 2008-04-10

see following commit by Roman Zippel:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=76b0c26af2736b7e5b87e6ed7ab63901483d5736

Note You need to log in before you can comment on or make changes to this bug.