Intro
GFS2 and OCFS2 are 2 cluster filesystems in linux kernel. We also support GFS2, though most of our customers use OCFS2 as we recommend. Last hackweek, from a user perspective, I learned about the difference of usage, features and performance between them. This time, I'd like to look into the design of GFS2 from a developer side.
Goals I want to achieve:
1. Look back a bit history of ocfs2 and gfs2 when they were merged into kernel;
2. Learn about the disk layout of gfs2;
3. Get the idea of how gfs2 manages its meta-data and data;
4. To known the way how gfs2 employs DLM;
5. Get the current status of gfs2 relative packages on SUSE.
History
- Originally GFS was a research project at the University of Minnesota
- It came out of work on ocean current simulation
-
Needed to store large amounts of data
-
Needed to allow for simultaneous access from a number of nodes
-
-
In late 1999/early 2000 Sistina Software took over development of GFS
-
Sistina was acquired by Red Hat in late 2003
-
Steven Whitehouse worked on some of the parts of the original GFS and joined Red Hat in late 2005, took over the work on GFS2 from Ken Preslan, who was the original author of most of the code in GFS
The ondisk format
- A gap (historical)
- The superblock
- Pointers to locations of “root” and the root of the metafs (gfs2)
- Resource groups (think ext2/3 block groups):
- A resource group header
- Bitmaps (two bits per block): Allocated/free, Data/metadata (inode),“Free metadata” state originally unused in gfs2, now used for“unlinked, but still open” inodes
- The data/metadata blocks
- Not extent-based filesystem
And …
“The GFS2 Filesystem”:
https://www.kernel.org/doc/ols/2007/ols2007v2-pages-253-260.pdf
Usage of DLM
- Only support DLM(fs/dlm), while o2cb is a plus for OCFS2
- DLM lock holder: tracking of the processes, which benefits “hang” problem troubleshooting a lot
- Lock modes: exclusive, shared and deferred
Reference
[1] http://www.ukuug.org/events/seminars/fab/programme/whitehouse.pdf
来源:oschina
链接:https://my.oschina.net/u/2475751/blog/701757