5 ms·
Which brings up a good question: how many of ext4's 60,000 lines of code are compatibility drivers for ext3 and ext2?
by desdiv 11y ago
Which brings up a good question: how many of ext4's 60,000 lines of code are compatibility drivers for ext3 and ext2?
- tanderson92 11y agoDoesn't the statement > "The ext4 driver has been able to register itself as ext[23] for quite some time now, so it's transparent." itself imply that ext4 merely builds on ext2/3 ? That is, there shouldn't be too much compatibility code, since 3/4 are logical extensions of ext2. The need for a split was explained in the article and more by Linus: it wasn't incompatibility but the scary possibility for instability in a filesystem that most people used as the canonical linux filesystem. edit: think of ext3/4 as a fully backwards compatible 'branch' that is only now being 'merged' back in.
- justizin 11y agoIIRC once you mount an ext2/3 volume as ext4, you can't go back. ext4 has made a lot of improvements, but has also had a lot of corruption issues, even if corner cases. If you don't need extremely large files or extremely cluttered directory structures, you don't _need_ ext4, though I haven't compared directly in a few years, and I suspect a lot of these stability issues have shaken out. The worst I experienced was kvm guests with ext4 filesystems stored in files on ext4 filesystems causing the not only the guest, but often the _host_ filesystem to go corrupt. Obviously, using LVM volumes or basically anything but filesystem images for production VMs would have avoided this, but the infrastructure I supported at the time already had a lot of this in place and too many other problems to solve to focus on it.
- JoshTriplett 11y agoIf you actually mount it as ext4 and enable the new features, yes. However, if you mount ext2 or ext3 using the ext2/3 implementation in the ext4 driver, that doesn't break backward compatibility with ext2/3.
- deleted 11y ago[deleted]
- madars 11y agoAccording to Ted Ts'o (maintainer of ext4): "the main reason why we did the ext3 -> ext4 fork was that adding 64-bit numbers required major surgery, and we didn't want to break a lot of production users who were using ext3. But from a file system format perspective, ext2, ext3, and ext4 are the same logical file system." (http://article.gmane.org/gmane.linux.file-systems/97986 http://article.gmane.org/gmane.linux.file-systems/97986)
- malkia 11y agoThanks madars! This is actually the link (2nd one) I wanted to post.
- knome 11y agoIt's actually really interesting, some of the backwards compatibility features. For example, directory hashes that allow fast name lookup are hidden inside of "empty" elements of the previous list format so that older drivers can still find files in the newer versions of the file system. Many structures also include their size, so that drivers can tell how much functionality any given element supports by which fields it contains or omits.
- malkia 11y agoreminds of FAT, where clever scheme was put to keep the long file names in between the short ones, using several records, all begining with \0x00 so that they are ignored.
- deleted 11y ago[deleted]