<s>
In	O
computing	O
,	O
the	O
Global	B-Application
File	I-Application
System	I-Application
2	I-Application
or	O
GFS2	B-Application
is	O
a	O
shared-disk	O
file	O
system	O
for	O
Linux	B-Application
computer	B-Architecture
clusters	I-Architecture
.	O
</s>
<s>
GFS2	B-Application
allows	O
all	O
members	O
of	O
a	O
cluster	B-Architecture
to	O
have	O
direct	O
concurrent	O
access	O
to	O
the	O
same	O
shared	O
block	B-General_Concept
storage	I-General_Concept
,	O
in	O
contrast	O
to	O
distributed	O
file	O
systems	O
which	O
distribute	O
data	O
throughout	O
the	O
cluster	B-Architecture
.	O
</s>
<s>
GFS2	B-Application
can	O
also	O
be	O
used	O
as	O
a	O
local	O
file	O
system	O
on	O
a	O
single	O
computer	O
.	O
</s>
<s>
GFS2	B-Application
has	O
no	O
disconnected	O
operating-mode	O
,	O
and	O
no	O
client	O
or	O
server	O
roles	O
.	O
</s>
<s>
All	O
nodes	O
in	O
a	O
GFS2	B-Application
cluster	B-Architecture
function	O
as	O
peers	O
.	O
</s>
<s>
Using	O
GFS2	B-Application
in	O
a	O
cluster	B-Architecture
requires	O
hardware	O
to	O
allow	O
access	O
to	O
the	O
shared	O
storage	O
,	O
and	O
a	O
lock	O
manager	O
to	O
control	O
access	O
to	O
the	O
storage	O
.	O
</s>
<s>
The	O
lock	O
manager	O
operates	O
as	O
a	O
separate	O
module	O
:	O
thus	O
GFS2	B-Application
can	O
use	O
the	O
Distributed	B-Operating_System
Lock	I-Operating_System
Manager	I-Operating_System
(	O
DLM	B-Operating_System
)	O
for	O
cluster	B-Architecture
configurations	O
and	O
the	O
"	O
nolock	O
"	O
lock	O
manager	O
for	O
local	O
filesystems	O
.	O
</s>
<s>
GFS	O
and	O
GFS2	B-Application
are	O
free	B-Application
software	I-Application
,	O
distributed	O
under	O
the	O
terms	O
of	O
the	O
GNU	B-License
General	I-License
Public	I-License
License	I-License
.	O
</s>
<s>
It	O
was	O
originally	O
written	O
for	O
SGI	O
's	O
IRIX	B-Operating_System
operating	O
system	O
,	O
but	O
in	O
1998	O
it	O
was	O
ported	O
to	O
Linux	B-Application
since	O
the	O
open	B-Application
source	I-Application
code	I-Application
provided	O
a	O
more	O
convenient	O
development	O
platform	O
.	O
</s>
<s>
In	O
late	O
1999/early	O
2000	O
it	O
made	O
its	O
way	O
to	O
Sistina	O
Software	O
,	O
where	O
it	O
lived	O
for	O
a	O
time	O
as	O
an	O
open-source	B-License
project	O
.	O
</s>
<s>
But	O
OpenGFS	O
and	O
OpenDLM	O
became	O
defunct	O
,	O
since	O
Red	O
Hat	O
purchased	O
Sistina	O
in	O
December	O
2003	O
and	O
released	O
GFS	O
and	O
many	O
cluster-infrastructure	O
pieces	O
under	O
the	O
GPL	B-License
in	O
late	O
June	O
2004	O
.	O
</s>
<s>
A	O
further	O
development	O
,	O
GFS2	B-Application
derives	O
from	O
GFS	O
and	O
was	O
included	O
along	O
with	O
its	O
distributed	B-Operating_System
lock	I-Operating_System
manager	I-Operating_System
(	O
shared	O
with	O
GFS	O
)	O
in	O
Linux	O
2.6.19	O
.	O
</s>
<s>
Red	O
Hat	O
Enterprise	O
Linux	B-Application
5.2	O
included	O
GFS2	B-Application
as	O
a	O
kernel	B-Operating_System
module	O
for	O
evaluation	O
purposes	O
.	O
</s>
<s>
With	O
the	O
5.3	O
update	O
,	O
GFS2	B-Application
became	O
part	O
of	O
the	O
kernel	B-Operating_System
package	O
.	O
</s>
<s>
GFS2	B-Application
forms	O
part	O
of	O
the	O
Fedora	O
,	O
Red	O
Hat	O
Enterprise	O
Linux	B-Application
and	O
associated	O
CentOS	O
Linux	B-Application
distributions	O
.	O
</s>
<s>
Users	O
can	O
purchase	O
commercial	O
support	O
to	O
run	O
GFS2	B-Application
fully	O
supported	O
on	O
top	O
of	O
Red	O
Hat	O
Enterprise	O
Linux	B-Application
.	O
</s>
<s>
As	O
of	O
Red	O
Hat	O
Enterprise	O
Linux	B-Application
8.3	O
,	O
GFS2	B-Application
is	O
supported	O
in	O
cloud	B-Architecture
computing	I-Architecture
environments	O
in	O
which	O
shared	O
storage	O
devices	O
are	O
available	O
.	O
</s>
<s>
The	O
design	O
of	O
GFS	O
and	O
of	O
GFS2	B-Application
targets	O
SAN-like	O
environments	O
.	O
</s>
<s>
This	O
can	O
take	O
the	O
form	O
of	O
iSCSI	B-Protocol
,	O
FibreChannel	B-Architecture
,	O
AoE	B-Protocol
,	O
or	O
any	O
other	O
device	O
which	O
can	O
be	O
presented	O
under	O
Linux	B-Application
as	O
a	O
block	O
device	O
shared	O
by	O
a	O
number	O
of	O
nodes	O
,	O
for	O
example	O
a	O
DRBD	B-Application
device	O
.	O
</s>
<s>
The	O
DLM	B-Operating_System
requires	O
an	O
IP	B-Protocol
based	O
network	O
over	O
which	O
to	O
communicate	O
.	O
</s>
<s>
Depending	O
upon	O
the	O
choice	O
of	O
SAN	O
,	O
it	O
may	O
be	O
possible	O
to	O
combine	O
this	O
,	O
but	O
normal	O
practice	O
involves	O
separate	O
networks	O
for	O
the	O
DLM	B-Operating_System
and	O
storage	O
.	O
</s>
<s>
The	O
GFS	O
requires	O
a	O
fencing	B-Operating_System
mechanism	O
of	O
some	O
kind	O
.	O
</s>
<s>
This	O
is	O
a	O
requirement	O
of	O
the	O
cluster	B-Architecture
infrastructure	O
,	O
rather	O
than	O
GFS/GFS2	O
itself	O
,	O
but	O
it	O
is	O
required	O
for	O
all	O
multi-node	O
clusters	O
.	O
</s>
<s>
DRAC	O
,	O
IPMI	O
,	O
or	O
ILO	B-Device
)	O
.	O
</s>
<s>
Virtual	O
and	O
hypervisor-based	O
fencing	B-Operating_System
mechanisms	O
can	O
also	O
be	O
used	O
.	O
</s>
<s>
Fencing	B-Operating_System
is	O
used	O
to	O
ensure	O
that	O
a	O
node	O
which	O
the	O
cluster	B-Architecture
believes	O
to	O
be	O
failed	O
cannot	O
suddenly	O
start	O
working	O
again	O
while	O
another	O
node	O
is	O
recovering	O
the	O
journal	O
for	O
the	O
failed	O
node	O
.	O
</s>
<s>
Although	O
the	O
designers	O
of	O
GFS/GFS2	O
aimed	O
to	O
emulate	O
a	O
local	O
filesystem	O
closely	O
,	O
there	O
are	O
a	O
number	O
of	O
differences	O
to	O
be	O
aware	O
of	O
.	O
</s>
<s>
Some	O
of	O
these	O
are	O
due	O
to	O
the	O
existing	O
filesystem	O
interfaces	O
not	O
allowing	O
the	O
passing	O
of	O
information	O
relating	O
to	O
the	O
cluster	B-Architecture
.	O
</s>
<s>
The	O
flock( )	O
system	O
call	O
on	O
GFS/GFS2	O
is	O
not	O
interruptible	O
by	O
signals	B-Operating_System
.	O
</s>
<s>
Since	O
this	O
is	O
a	O
cluster	B-Architecture
filesystem	O
,	O
that	O
PID	O
might	O
refer	O
to	O
a	O
process	O
on	O
any	O
of	O
the	O
nodes	O
which	O
have	O
the	O
filesystem	O
mounted	O
.	O
</s>
<s>
The	O
other	O
main	O
difference	O
,	O
and	O
one	O
that	O
is	O
shared	O
by	O
all	O
similar	O
cluster	B-Architecture
filesystems	O
,	O
is	O
that	O
the	O
cache	O
control	O
mechanism	O
,	O
known	O
as	O
glocks	O
(	O
pronounced	O
Gee-locks	O
)	O
for	O
GFS/GFS2	O
,	O
has	O
an	O
effect	O
across	O
the	O
whole	O
cluster	B-Architecture
.	O
</s>
<s>
Each	O
inode	B-Application
on	O
the	O
filesystem	O
has	O
two	O
glocks	O
associated	O
with	O
it	O
.	O
</s>
<s>
One	O
(	O
called	O
the	O
iopen	O
glock	O
)	O
keeps	O
track	O
of	O
which	O
processes	O
have	O
the	O
inode	B-Application
open	O
.	O
</s>
<s>
The	O
other	O
(	O
the	O
inode	B-Application
glock	O
)	O
controls	O
the	O
cache	O
relating	O
to	O
that	O
inode	B-Application
.	O
</s>
<s>
Each	O
of	O
the	O
four	O
modes	O
maps	O
directly	O
to	O
a	O
DLM	B-Operating_System
lock	O
mode	O
.	O
</s>
<s>
When	O
in	O
EX	O
mode	O
,	O
an	O
inode	B-Application
is	O
allowed	O
to	O
cache	O
data	O
and	O
metadata	O
(	O
which	O
might	O
be	O
"	O
dirty	O
"	O
,	O
i.e.	O
</s>
<s>
In	O
SH	O
mode	O
,	O
the	O
inode	B-Application
can	O
cache	O
data	O
and	O
metadata	O
,	O
but	O
it	O
must	O
not	O
be	O
dirty	O
.	O
</s>
<s>
In	O
DF	O
mode	O
,	O
the	O
inode	B-Application
is	O
allowed	O
to	O
cache	O
metadata	O
only	O
,	O
and	O
again	O
it	O
must	O
not	O
be	O
dirty	O
.	O
</s>
<s>
In	O
UN	O
mode	O
,	O
the	O
inode	B-Application
must	O
not	O
cache	O
any	O
metadata	O
.	O
</s>
<s>
In	O
order	O
that	O
operations	O
which	O
change	O
an	O
inode	B-Application
's	O
data	O
or	O
metadata	O
do	O
not	O
interfere	O
with	O
each	O
other	O
,	O
an	O
EX	O
lock	O
is	O
used	O
.	O
</s>
<s>
This	O
means	O
that	O
certain	O
operations	O
,	O
such	O
as	O
create/unlink	O
of	O
files	O
from	O
the	O
same	O
directory	O
and	O
writes	O
to	O
the	O
same	O
file	O
should	O
be	O
,	O
in	O
general	O
,	O
restricted	O
to	O
one	O
node	O
in	O
the	O
cluster	B-Architecture
.	O
</s>
<s>
The	O
single	O
most	O
frequently	O
asked	O
question	O
about	O
GFS/GFS2	O
performance	O
is	O
why	O
the	O
performance	O
can	O
be	O
poor	O
with	O
email	O
servers	O
.	O
</s>
<s>
GFS	O
and	O
GFS2	B-Application
are	O
both	O
journaled	B-Application
file	I-Application
systems	I-Application
;	O
and	O
GFS2	B-Application
supports	O
a	O
similar	O
set	O
of	O
journaling	B-Application
modes	O
as	O
ext3	B-Application
.	O
</s>
<s>
This	O
is	O
the	O
only	O
mode	O
supported	O
by	O
GFS	O
,	O
however	O
it	O
is	O
possible	O
to	O
turn	O
on	O
journaling	B-Application
on	O
individual	O
data-files	O
,	O
but	O
only	O
when	O
they	O
are	O
of	O
zero	O
size	O
.	O
</s>
<s>
no	O
support	O
for	O
the	O
mmap	B-Operating_System
or	O
sendfile	O
system	O
calls	O
,	O
they	O
also	O
use	O
a	O
different	O
on-disk	O
format	O
from	O
regular	O
files	O
.	O
</s>
<s>
This	O
can	O
be	O
used	O
instead	O
of	O
the	O
data	O
=	O
journal	O
mount	B-Application
option	O
which	O
ext3	B-Application
supports	O
(	O
and	O
GFS/GFS2	O
does	O
not	O
)	O
.	O
</s>
<s>
GFS2	B-Application
also	O
supports	O
data	O
=	O
ordered	O
mode	O
which	O
is	O
similar	O
to	O
data	O
=	O
writeback	O
except	O
that	O
dirty	O
data	O
is	O
synced	O
before	O
each	O
journal	O
flush	O
is	O
completed	O
.	O
</s>
<s>
This	O
ensures	O
that	O
blocks	O
which	O
have	O
been	O
added	O
to	O
an	O
inode	B-Application
will	O
have	O
their	O
content	O
synced	O
back	O
to	O
disk	O
before	O
the	O
metadata	O
is	O
updated	O
to	O
record	O
the	O
new	O
size	O
and	O
thus	O
prevents	O
uninitialised	O
blocks	O
appearing	O
in	O
a	O
file	O
under	O
node	O
failure	O
conditions	O
.	O
</s>
<s>
The	O
default	O
journaling	B-Application
mode	O
is	O
data	O
=	O
ordered	O
,	O
to	O
match	O
ext3	B-Application
's	O
default	O
.	O
</s>
<s>
,	O
GFS2	B-Application
does	O
not	O
yet	O
support	O
data	O
=	O
journal	O
mode	O
,	O
but	O
it	O
does	O
(	O
unlike	O
GFS	O
)	O
use	O
the	O
same	O
on-disk	O
format	O
for	O
both	O
regular	O
and	O
journaled	O
files	O
,	O
and	O
it	O
also	O
supports	O
the	O
same	O
journaled	O
and	O
inherit-journal	O
attributes	O
.	O
</s>
<s>
GFS2	B-Application
also	O
relaxes	O
the	O
restrictions	O
on	O
when	O
a	O
file	O
may	O
have	O
its	O
journaled	O
attribute	O
changed	O
to	O
any	O
time	O
that	O
the	O
file	O
is	O
not	O
open	O
(	O
also	O
the	O
same	O
as	O
ext3	B-Application
)	O
.	O
</s>
<s>
For	O
performance	O
reasons	O
,	O
each	O
node	O
in	O
GFS	O
and	O
GFS2	B-Application
has	O
its	O
own	O
journal	O
.	O
</s>
<s>
In	O
GFS	O
the	O
journals	O
are	O
disk	O
extents	O
,	O
in	O
GFS2	B-Application
the	O
journals	O
are	O
just	O
regular	O
files	O
.	O
</s>
<s>
The	O
number	O
of	O
nodes	O
which	O
may	O
mount	B-Application
the	O
filesystem	O
at	O
any	O
one	O
time	O
is	O
limited	O
by	O
the	O
number	O
of	O
available	O
journals	O
.	O
</s>
<s>
GFS2	B-Application
adds	O
a	O
number	O
of	O
new	O
features	O
which	O
are	O
not	O
in	O
GFS	O
.	O
</s>
<s>
GFS2	B-Application
supports	O
I/O	O
barriers	O
(	O
on	O
by	O
default	O
,	O
assuming	O
underlying	O
device	O
supports	O
it	O
.	O
</s>
<s>
GFS2	B-Application
was	O
designed	O
so	O
that	O
upgrading	O
from	O
GFS	O
would	O
be	O
a	O
simple	O
procedure	O
.	O
</s>
<s>
The	O
journaling	B-Application
systems	O
of	O
GFS	O
and	O
GFS2	B-Application
are	O
not	O
compatible	O
with	O
each	O
other	O
.	O
</s>
<s>
Some	O
spare	O
blocks	O
in	O
the	O
GFS	O
journals	O
are	O
used	O
to	O
create	O
the	O
(	O
very	O
small	O
)	O
files	O
required	O
by	O
GFS2	B-Application
during	O
the	O
update	O
process	O
.	O
</s>
<s>
The	O
GFS2	B-Application
"	O
meta	O
filesystem	O
"	O
is	O
not	O
a	O
filesystem	O
in	O
its	O
own	O
right	O
,	O
but	O
an	O
alternate	O
root	B-Application
of	O
the	O
main	O
filesystem	O
.	O
</s>
<s>
Although	O
it	O
behaves	O
like	O
a	O
"	O
normal	O
"	O
filesystem	O
,	O
its	O
contents	O
are	O
the	O
various	O
system	O
files	O
used	O
by	O
GFS2	B-Application
,	O
and	O
normally	O
users	O
do	O
not	O
need	O
to	O
ever	O
look	O
at	O
it	O
.	O
</s>
<s>
The	O
GFS2	B-Application
utilities	O
mount	B-Application
and	O
unmount	B-Application
the	O
meta	O
filesystem	O
as	O
required	O
,	O
behind	O
the	O
scenes	O
.	O
</s>
