From cef2ac104d45c351344cd10ac1419ad5f6422d8b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 4 Apr 2006 19:23:41 -0400 Subject: [PATCH] Fix ext2fs_add_journal_inode() when filesystem is opened in exclusive mode If the filesystem is opened in exclusive mode, then device will be busy by definition, so don't return -EBUSY. This caused mke2fs -j to fail on the 1.39-WIP (29-Mar-2006) release. (Addresses Debian Bug: #360652) Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/ChangeLog | 8 ++++++++ lib/ext2fs/mkjournal.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 4a12f78..ff579b7 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,11 @@ +2006-04-04 Theodore Ts'o + + * mkjournal.c (ext2fs_add_journal_inode): If the filesystem is + opened in exclusive mode, then device will be busy by + definition, so don't return -EBUSY. This caused mke2fs -j + to fail on the 1.39-WIP (29-Mar-2006) release. (Addresses + Debian Bug: #360652) + 2006-03-29 Theodore Ts'o * bitops.h (ext2fs_set_bit, ext2fs_clear_bit): Fix the constraints diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 4fe67c5..8af8acd 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -370,7 +370,8 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags) close(fd); journal_ino = st.st_ino; } else { - if (mount_flags & EXT2_MF_BUSY) { + if ((mount_flags & EXT2_MF_BUSY) && + !(fs->flags & EXT2_FLAG_EXCLUSIVE)) { retval = EBUSY; goto errout; } -- 1.8.3.1