Implement HFSPlus Journal on Linux

naota

Short description: This project aim to implement HFSPlus journal feature on Linux kernel. HFSPlus is a filesystem mostly on MacOS. Currently we have HFSPlus write access only if the journal feature is disabled. Every year, Apple deploy new notebook computers, which has larger power off risk than desktop ones, so it is not good to disable the feature. With journal supported, life with Linux on dual-booting Mac will be more easy and fun.

Introduction

HFSPlus is a filesystem used in modern MacOS machines. HFSPlus has several extensions to HFS, including 32-bit allocation blocks, 255-character unicode filenames, and file sizes of 2^63 bytes.

Current Linux HFSPlus can write to the filesystem only when it is not journaled. (You have "force" option to do it at your own risk. Not a good idea.) Now storage size become larger and Apple deploy many notebooks which has risk to lost its power, disabling journal feature is too dangerous way to take.

Take a look at userland tools. Apple publish its "fsck" and "newfs" source code with APSL (FSF approved opensource license) and Linux ported Debian package "hfsprogs" is maintained based on it. But the version is a bit old and lack some important features like journal replaying.

So the project goal is:

  • To update HFSPlus userland tools
  • To implement HFSPlus journal feature in Linux kernel
    • journal writing feature
    • journal replaying feature
    • interface for userland tools

With HFSPlus journal supported on Linux, life on Mac and Linux booting machine would be much easier and more fun.

About myself
Name: Naohiro Aota
Email: naota@elisp.net
IRC: naota (freenode)
Website: http://elisp.net
Current position: Undergraduate student at Osaka University, Japan

I'm building and testing Linux kernel on both x86 and amd64 machines. I'm also working to port FreeBSD kernel to Gdium (MIPS).

On non-kernel area, I ported Gentoo system to DragonFly BSD as last year GSoC project and now I'm Gentoo developer, so I have deep knowledge of system packages and toolchains like gcc, binutils or dynamic loader. I'm working with some Emacs related projects too. For example, I'm a maintainor of emacs-w3m and navi2ch. I write code with Emacs Lisp, C, C++, Haskell, Perl, PHP and Python. I love lerning languages (including natural ones).

Implementation plan
Milestone 0: (4/25 - May)
  • Read/learn
    • HFSPlus userland tools
    • curent HFSPlus kernel implementation
    • VFS code
  • Get in touch with Debian hfsprogs maintainor to talk about updating the userland tools
Milestone 1: week 1 - week 2
  • Update newfs tool
  • Confirm created HFSPlus filesystem image is mount'able both with Linux and MacOS.
Milestone 2: week 3 - week 4
  • Update fsck tool
  • Confirm non-journaled HFSPlus filesystem can be fsck'ed with the tool
  • At this point, no kernel code is changed.
Milestone 3: week 5
  • Cross check
    • mkfs with MacOS tool and fsck with Linux ported tool
    • mkfs with Linux tool and fsck with MacOS tool
  • May need some fix here.
Milestone 4: week 6 - week 7
  • Implementat userland tool to write dummy journal into HFSPlus iamge file
  • Implementat kernel side journal replaying feature.
Milestone 5: week 8 (mid-term)
  • Confirm manual replaying with fsck is working
  • What to do be done at mid-term evaluation
    • implementing userland tools
    • journal replaying
Milestone 6: week 9 - week 11
  • Implement journaled writing feature.
    • Write to journal data
    • Live replaying the journal data
Milestone 7: week 12
  • Confirm journaled read/write is working well.
  • (optional work) implement extra features
    • metazone data
    • Hot files
Milestone 13: week 13 (pencil down)
  • Write/update HFSPlus userland documentation.