Whamcloud - gitweb
Reserve superblock fields for multiple mount protection feature
authorAndreas Dilger <adilger@clusterfs.com>
Thu, 31 May 2007 16:25:46 +0000 (12:25 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 31 May 2007 16:25:46 +0000 (12:25 -0400)
commitb62e88af6a1be97b224a3e5c1fea43fa173567ea
treebed9755096ae0221adc952c64d053a12be738a0d
parente7b5d3c0b2bb1bafc5be57796ac1b68b1ac8e983
Reserve superblock fields for multiple mount protection feature

There have been reported instances of a filesystem having been mounted
at 2 places at the same time causing a lot of damage to the
filesystem. This patch reserves superblock fields and an INCOMPAT flag
for adding multiple mount protection(MMP) support within the ext4
filesystem itself. The superblock will have a block number
(s_mmp_block) which will hold a MMP structure which has a sequence
number which will be periodically updated every 5 seconds by a mounted
filesystem. Whenever a filesystem will be mounted it will wait for
s_mmp_interval seconds to make sure that the MMP sequence does not
change. To further make sure, we write a random sequence number into
the MMP block and wait for another s_mmp_interval secs. If the
sequence no. doesn't change then the mount will succeed. In case of
failure, the nodename, bdevname and the time at which the MMP block
was last updated will be displayed. tune2fs can be used to set
s_mmp_interval as desired.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_fs.h