From: Theodore Ts'o Date: Sun, 26 Sep 2010 01:14:06 +0000 (-0400) Subject: e2fsck: Open the external journal in exclusive mode X-Git-Tag: debian-1.41.12-3~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0173cbcf128f0b2b36034ea6d80ce68fb1d7dd8f;p=tools%2Fe2fsprogs.git 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" --- 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;