Whamcloud - gitweb
Fix ext2fs_add_journal_inode() when filesystem is opened in exclusive mode
authorTheodore Ts'o <tytso@mit.edu>
Tue, 4 Apr 2006 23:23:41 +0000 (19:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 4 Apr 2006 23:23:41 +0000 (19:23 -0400)
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" <tytso@mit.edu>
lib/ext2fs/ChangeLog
lib/ext2fs/mkjournal.c

index 4a12f78..ff579b7 100644 (file)
@@ -1,3 +1,11 @@
+2006-04-04  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * bitops.h (ext2fs_set_bit, ext2fs_clear_bit): Fix the constraints
index 4fe67c5..8af8acd 100644 (file)
@@ -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;
                }