summaryrefslogtreecommitdiff
path: root/e2fsck/journal.c
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@whamcloud.com>2011-09-24 13:48:55 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-25 01:55:23 -0400
commit0f5eba7501f467f757792ee449d16c9259b994fd (patch)
tree017ff4ababf519440760ecb49bcc43a5cd618d15 /e2fsck/journal.c
parent6747ac86b9b4eac864af768a2fa09b8a22e363a5 (diff)
downloade2fsprogs-0f5eba7501f467f757792ee449d16c9259b994fd.tar.gz
ext2fs: add multi-mount protection (INCOMPAT_MMP)
Multi-mount protection is feature that allows mke2fs, e2fsck, and others to detect if the filesystem is mounted on a remote node (on SAN disks) and avoid corrupting the filesystem. For e2fsprogs this means that it checks the MMP block to see if the filesystem is in use, and marks the filesystem busy while e2fsck is running on the system. This is useful on SAN disks that are shared between high-availability servers, or accessible by multiple nodes that aren't in HA pairs. MMP isn't intended to serve as a primary HA exclusion mechanism, but as a failsafe to protect against user, software, or hardware errors. There is no requirement that e2fsck updates the MMP block at regular intervals, but e2fsck does this occasionally to provide useful information to the sysadmin in case of a detected conflict. For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to periodically write to disk (every few seconds by default) to notify other nodes that the filesystem is still in use and unsafe to modify. Originally-by: Kalpak Shah <kalpak@clusterfs.com> Signed-off-by: Johann Lombardi <johann@whamcloud.com> Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/journal.c')
-rw-r--r--e2fsck/journal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 561ff340..915b8bbf 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -882,6 +882,8 @@ int e2fsck_run_ext3_journal(e2fsck_t ctx)
ctx->fs->io->manager->get_stats(ctx->fs->io, &stats);
if (stats && stats->bytes_written)
kbytes_written = stats->bytes_written >> 10;
+
+ ext2fs_mmp_stop(ctx->fs);
ext2fs_free(ctx->fs);
retval = ext2fs_open(ctx->filesystem_name, EXT2_FLAG_RW,
ctx->superblock, blocksize, io_ptr,