From 8718359b4057bf2b998f4ac6125e33f20efe60cb Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 25 Sep 2010 21:14:06 -0400 Subject: [PATCH] e2fsck: Open the external journal in exclusive mode This prevents accidentally replaying and resetting the journal while it is mounted, due to an accidental attempt to run e2fsck on an LVM snapshot of a file system with an external journal. Addresses-Debian-Bug: #587531 Signed-off-by: "Theodore Ts'o" --- e2fsck/journal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2fsck/journal.c b/e2fsck/journal.c index 64a0fd6..b741eb9 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -368,7 +368,8 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal) #ifndef USE_INODE_IO if (ext_journal) #endif - retval = io_ptr->open(journal_name, IO_FLAG_RW, + retval = io_ptr->open(journal_name, + IO_FLAG_RW | IO_FLAG_EXCLUSIVE, &ctx->journal_io); if (retval) goto errout; -- 1.8.3.1