PORTING THE HAMMER FILE SYSTEM TO LINUX Daniel Lorch June 10, 2009 - - PowerPoint PPT Presentation

porting the hammer file system to linux
SMART_READER_LITE
LIVE PREVIEW

PORTING THE HAMMER FILE SYSTEM TO LINUX Daniel Lorch June 10, 2009 - - PowerPoint PPT Presentation

Porting the HAMMER File System to Linux Daniel Lorch 1/13 PORTING THE HAMMER FILE SYSTEM TO LINUX Daniel Lorch June 10, 2009 Outline 2/13 Motivation 1. A Hammer File System Walkthrough 2. Tool Evaluation 3. Porting Work 4. Demo 5.


slide-1
SLIDE 1

PORTING THE HAMMER FILE SYSTEM TO LINUX

Daniel Lorch

June 10, 2009

1/13 Porting the HAMMER File System to Linux — Daniel Lorch

slide-2
SLIDE 2

Outline

1.

Motivation

2.

A Hammer File System Walkthrough

3.

Tool Evaluation

4.

Porting Work

5.

Demo

6.

Questions

June 10, 2009

2/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-3
SLIDE 3
  • 1. Motivation

„A few“

„Millions“

Number of DragonFly BSD Users Number of Linux Users

more users ⇨ more peer reviewers

June 10, 2009

3/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-4
SLIDE 4
  • 2. Hammer File System Walkthrough (1/3)

 Fine Grained History Retention

# echo Hello > test # echo World >> test # hammer history test test 000000010061aac0 clean { 00000001007a1520 23-Mar-2009 20:04:11 00000001007a1580 23-Mar-2009 20:04:43 } # cat test@@0x00000001007a1520 Hello # cat test@@0x00000001007a1580 Hello World

June 10, 2009

4/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-5
SLIDE 5
  • 2. Hammer File System Walkthrough (2/3)

 File System Snapshots

 Same mechanism as for files: Append transaction id to

directory name

 „hammer snapshot“ command conveniently creates these

softlinks

# hammer snapshot /mnt /mnt/snap /mnt/snap # ls -l snap lrwxr-xr-x 1 root wheel 25 Mar 23 20:07 snap -> /mnt/ @@0x00000001007a15c0 # ls snap/ test

June 10, 2009

5/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-6
SLIDE 6
  • 2. Hammer File System Walkthrough (3/3)

 Master-Slave Replication

 Single Master, Multiple Slaves  Pairing via unique „uuid“  Replication initiated manually with „hammer mirror-

copy“ command; peers can be remote (via SSH)

 Incremental mirroring: since transaction ids are strictly

incremental, only need to negotiate on range to transmit

June 10, 2009

6/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-7
SLIDE 7
  • 3. Tool Evaluation (1/2)

 „So, you want to write a kernel module. You know C,

you've written a few normal programs to run as processes, and now you want to get to where the real action is, to where a single wild pointer can wipe out your file system and a core dump means a reboot.” – Peter Jay Salzman, The Linux Kernel Module Programming Guide

⇨ decided to use a virtualization software

June 10, 2009

7/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-8
SLIDE 8
  • 3. Tool Evaluation (2/2)

 Tried VMWare with „guest debug monitor feature“,

but couldn‘t load debug symbols on my Mac

 Tried User-Mode-Linux ⇨ Good!

 It’s even part of the standard Linux kernel

 Tried DragonFly‘s vKernels ⇨ Good!

 It’s even part of standard DragonFly BSD

./vmlinux ubda=../Slackware-12.2-root_fs ubdb=../hammerdisk.raw ./kernel -m 64m -r ../rootimg.01 -r /home/ hammerdisk.raw –n1

June 10, 2009

8/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-9
SLIDE 9
  • 4. Porting Work (1/3)

 „Cowboy-style“ programming: 1.

Add a source file

2.

Fix errors

3.

Goto 1

 Looked at this screen for weeks:

$ make ARCH=um 2>&1 | grep 'error: ' | sed -e 's/.*error: //g' | sort | uniq 'EFTYPE' undeclared (first use in this function) 'FREAD' undeclared (first use in this function) 'FSCRED' undeclared (first use in this function) 'FWRITE' undeclared (first use in this function) 'LK_EXCLUSIVE' undeclared (first use in this function) ...

June 10, 2009

9/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-10
SLIDE 10
  • 4. Porting Work (2/3)

 Idea: Wrapper Files

 For compiler errors, add missing definition to

dfly_wrap.h, then used it like this:

 For linker errors, add stub function to dfly_wrap.c

causing kernel panic:

 Result:

 14 out of 18 source files re-used without modification int nlookup(struct nlookupdata *nd) { panic("nlookup"); } #include "dfly_wrap.h" #include "dfly/vfs/hammer/hammer_prune.c"

June 10, 2009

10/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-11
SLIDE 11
  • 4. Porting Work (3/3)

 Finally, executed kernel and fixed kernel panics,

  • ne after the other

 Some stubs are still there..

 ..don‘t run file system on a live system (yet)

June 10, 2009

11/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-12
SLIDE 12

Demo

June 10, 2009

12/13

Porting the HAMMER File System to Linux — Daniel Lorch

slide-13
SLIDE 13

Questions?

June 10, 2009

13/13

Porting the HAMMER File System to Linux — Daniel Lorch