In ext2fs_add_journal_inode() check for the case where the filesystem
appears to be unmounted, but the device is still apparently busy.
This can happen when the luser doesn't bother to mount /proc and has a
bogus /etc/mtab, but still wants to mount the filesystem before using
tune2fs(?!?). Add a safety check to save him from his own stupidity,
at least on 2.6 kernels. (Addresses Debian Bug #319002)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+2005-07-19 Theodore Ts'o <tytso@mit.edu>
+
+ * mkjournal.c (ext2fs_add_journal_inode): Check for the case where
+ the filesystem is apparently not mounted, but the device
+ is still busy. This can happy when the luser doesn't
+ bother to mount /proc and has a bogus /etc/mtab. Add a
+ safety check to save him from his own stupidity, at least
+ on 2.6 kernels. (Addresses Debian Bug #319002)
+
2005-07-09 Andreas Dilger <adilger@clusterfs.com>
* getsize.c (ext2fs_get_device_size): Use fstat/fstat64 to get
close(fd);
journal_ino = st.st_ino;
} else {
+ if (mount_flags & EXT2_MF_BUSY) {
+ retval = EBUSY;
+ goto errout;
+ }
journal_ino = EXT2_JOURNAL_INO;
if ((retval = write_journal_inode(fs, journal_ino,
size, flags)))