[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

tune2fs 1.21 ext2fs_add_journal_inode problem



Hi Ted, ext3 folks,

Here's what I get when trying to add an ext3 journal to a mounted ext2
filesystem here:

# tunefs -j /dev/hda5
tune2fs 1.21, 15-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Creating journal inode:
tune2fs: Bad file descriptor
        while trying to create journal file


which is not surprising, given that the filedescriptor is closed
(and not re-opened) before the fstat in ext2fs_add_journal_inode()

        if (mount_flags & EXT2_MF_MOUNTED) {
                strcat(jfile, "/.journal");
 
                /* Create the journal file */
                if ((fd = open(jfile, O_CREAT|O_WRONLY, 0600)) < 0)
                        return errno;
                close(fd);
 
                if ((retval = write_journal_file(fs, jfile, size, flags)))
                        return retval;
 
                /* Get inode number of the journal file */
                if (fstat(fd, &st) < 0)
                        return errno;


How is this code supposed to work? ;-)

Marc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]