hfsplus unlink problems

Bug #154416 reported by till busch
4
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
Hardy
Fix Released
Medium
Andy Whitcroft
linux-source-2.6.22 (Ubuntu)
Won't Fix
Undecided
Unassigned
Hardy
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: linux-image-2.6.22-14-generic

hi,

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 drops from n to 0 when removing a hard link to some file.

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

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Hardy Heron kernel was recently uploaded for testing. We'd really appreciate it if you could try testing with this newer kernel and verify if this issue still exists. Unfortunately, the Hardy Heron Alpha1 LiveCD was released with the older 2.6.22 kernel. You'll have to manually install the newer Hardy Heron kernel in order to test. This should not be the case for Alpha2 which is set to come out around Dec 20. However, here are the instructions to install if you choose to do so, otherwise just wait for Alpha2 to come out:

1) edit the file /etc/apt/sources.list and add the following line:

deb http://archive.ubuntu.com/ubuntu hardy main restricted

2) sudo apt-get update
3) sudo apt-get install linux-image-2.6.24-1-generic
4) reboot and select the new kernel from the grub menu

After you've tested, please feel free to revert back - ie boot into the old kernel, sudo apt-get remove linux-image-2.6.24-1-generic, and remove the line from /etc/apt/sources.list . Please update this report with your results. Thanks in advance!

Changed in linux:
status: New → Incomplete
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

I'm opened a new task against the actively developed kernel. However, I'm closing the report against linux-source-2.6.22 as it does not meet the criteria for a stable release update. You can learn more about the stable release update process at https://wiki.ubuntu.com/StableReleaseUpdates . Thanks!

Changed in linux-source-2.6.22:
status: New → Won't Fix
Revision history for this message
till busch (buti) wrote :

thanks leann for your suggestions. i just tested 2.6.24-1. i'm sorry, but 2.6.24-1 does not fix the problem. it persists just as before.
creating hard links links works fine (the link count is updated correctly).
deleting any file with multiple links sets the link count to 0 immediately (which also makes it impossible to delete the other links).

the main area where this makes trouble is .Xauthority -- since using hfsplus as my home partition i often get banned from using my X11. when i look at the .Xautority-file i see its link-count being 0 and its size being zero, too. i frequently need to boot to os x and run fsck_hfs to fix the link counts in my home directory and delete the broken files (that once were hard links).

greetings,

- till

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Thanks for the update Till. Per the kernel teams bug policy, can you please attach the following information for newer kernel:

* uname -a > uname-a.log
* cat /proc/version_signature > version.log
* dmesg > dmesg.log
* sudo lspci -vvnn > lspci-vvnn.log

Please be sure to attach each file as a separate attachment. For more information regarding the kernel team bug policy, please refer to https://wiki.ubuntu.com/KernelTeamBugPolicies . Thanks again and we appreciate your help and feedback.

Revision history for this message
till busch (buti) wrote :
Revision history for this message
till busch (buti) wrote :
Revision history for this message
till busch (buti) wrote :
Revision history for this message
till busch (buti) wrote :
Revision history for this message
till busch (buti) wrote :

also, i checked that the problem is still there in 2.6.24-2-generic

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
till busch (buti) wrote :

this was fixed by Roman Zippel on 2008-04-10 in linus' git tree.

see following commit:

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

maybe it can be backported? otherwise i hope it makes it into ubuntu 8.10

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Till,

Thanks for the upstream git commit id to reference. I glanced at the Hardy kernel git tree and see this patch is already included - thus it should already by in the Hardy kernel:

ogasawara@yoji:~/ubuntu-hardy$ git log 76b0c26af2736b7e5b87e6ed7ab63901483d5736
commit 76b0c26af2736b7e5b87e6ed7ab63901483d5736
Author: Roman Zippel <email address hidden>
Date: Wed Apr 9 17:44:07 2008 +0200

    HFS+: fix unlink of links

Also, I quickly checked to Intrepid Ibex git tree and it is there as well:

ogasawara@yoji:~/ubuntu-intrepid$ git log 76b0c26af2736b7e5b87e6ed7ab63901483d5736
commit 76b0c26af2736b7e5b87e6ed7ab63901483d5736
Author: Roman Zippel <email address hidden>
Date: Wed Apr 9 17:44:07 2008 +0200

    HFS+: fix unlink of links

Can you confirm this is fixed with the latest Hardy kernel (2.6.24-19) . Also, the latest Alpha for the upcoming Intrepid Ibex 8.10 is also available fore testing if you'd like to - http://www.ubuntu.com/testing . Please let us know if this is resolved. Thanks.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

I'm tentatively marking this "Fix Released". Till, if this is not the case feel free to set the status back to "New". Thanks.

Changed in linux:
status: Triaged → Fix Released
Revision history for this message
till busch (buti) wrote :

hi leann,

i have finally found the time to test again. the bug is gone in intrepid, but it is still there in hardy kernel
Linux 2.6.24-21-generic.

since hardy is LTS, i strongly opt for putting this in one of the next kernel updates. effectively this bug causes data loss. i have a patch, that i have written quite some time before finding the fix in the git tree. it replaces only a few lines of code in fs/hfsplus/dir.c and fixes the data loss problem. if you prefer to only add a minor patch, i can attach it here.

leaving this bug 'fix released' since it will work on intrepid.

cheers,

- till

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Till,

How odd, it seems the patch was in the Hardy git tree at one point (when I pasted it above) but doesn't look to be there now. I've gone ahead and opened the Hardy nomination. Thanks.

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
milestone: none → ubuntu-8.04.2
status: New → Confirmed
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Closing Hardy task for 2.6.22 since 2.6.22 was for Gutsy.

Changed in linux-source-2.6.22:
status: New → Invalid
Changed in linux:
status: Confirmed → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

Steve Langasek (vorlon)
Changed in linux:
milestone: ubuntu-8.04.2 → ubuntu-8.04.3
Andy Whitcroft (apw)
Changed in linux (Ubuntu Hardy):
assignee: nobody → Andy Whitcroft (apw)
status: Triaged → In Progress
Revision history for this message
Andy Whitcroft (apw) wrote :

The fix pointed out above is already included in the Hardy kernel, included in the Ubuntu-2.6.24-23.46 kernel. This kernel has already been released to all pockets. This was included as part of the stable updated 2.6.24.5 which was pulled in under bug #301632. Closing this bug Fix Released.

Andy Whitcroft (apw)
Changed in linux (Ubuntu Hardy):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.