Bug 36172
Summary: | "kernel BUG at fs/ext4/super.c" triggered after tune2fs/remount | ||
---|---|---|---|
Product: | File System | Reporter: | Christoph Biedl (bugzilla.kernel.bpeb) |
Component: | ext4 | Assignee: | fs_ext4 (fs_ext4) |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | alan, jack, mkatiyar, tytso |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.39 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | Possible fix attached. |
Description
Christoph Biedl
2011-05-29 19:23:47 UTC
Created attachment 60002 [details]
Possible fix attached.
This patch fixes it for me.
Sorry, the fix is wrong. The problem is that we set EXT4_SB(sb)->s_journal in ext4_fill_super() but we don't change it appropriately in ext4_remount() when journal feature could have changed. I'm actually not sure if this is even supposed to work - whether it isn't bug in tune2fs that it allows changing of has_journal feature on mounted filesystem. Because when tune2fs removes the feature and possibly other journal parameters from superblock, we really have not any guarantee that the journal is still correct. In fact the journal space could have been already reused for something else. So fixing this would need some careful look... Ted? Yes, either tune2fs should be fixed to not change the mounted fs state, or the code should be prepared to deal with it silently. Since the next mount isn't going to see the journal, it doesn't matter whether we clear the errors or not. Is this bug still present and relevant ? We should just fix this in tune2fs, and not allow the journal to be removed when the file system is mounted, even if it is only mounted read/only. I don't know what I was thinking when I allowed tune2fs to do this, but it just doesn't work. Even with this patch, the problem is that the journal (and its blocks) are released, and so when the file system gets remounted read/write, the kernel will try to use journaling after the remount, and this will cause all sorts of problems. We could add code to ext4 to detect this case and release the journalling structure, but it's going to be problematic for ext3, so we should just remove this capability from tune2fs. Fortunately it's not going to hit that many people, so it's probably not worth it to add support in ext4 just for the older versions of e2fsprogs; it's pretty rare that someone will want to disable the journal while the fs is mounted. So I'm going to close this as a kernel bug, and treat it as an e2fsprogs bug. > So I'm going to close this as a kernel bug, and treat it as an e2fsprogs bug.
I'm totally fine with this.
Regards, Christoph
|