]> git.pld-linux.org Git - packages/kernel.git/blame - panic-in-reiserfs_read_super.patch
- this patch fix twice EXPORT_SYMBOL(br_ioctl_hook); in kernel-source net/netsyms.c
[packages/kernel.git] / panic-in-reiserfs_read_super.patch
CommitLineData
1cbbdaac
JR
1 Small patch to fail gracefully in the case of IO error during journal
2 replay
3diff -rup linux-2.4.7-pre9/fs/reiserfs/super.c linux-2.4.7-pre9.patched/fs/reiserfs/super.c
4--- linux-2.4.7-pre9/fs/reiserfs/super.c Wed Jul 4 13:45:55 2001
5+++ linux-2.4.7-pre9.patched/fs/reiserfs/super.c Fri Jul 20 15:29:30 2001
6@@ -779,16 +779,23 @@ struct super_block * reiserfs_read_super
7
8 if (!(s->s_flags & MS_RDONLY)) {
9 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
10+ int old_magic;
11+
12+ old_magic = strncmp (rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
13+ strlen ( REISER2FS_SUPER_MAGIC_STRING));
14+ if( old_magic && le16_to_cpu(rs->s_version) != 0 ) {
15+ dput(s->s_root) ;
16+ s->s_root = NULL ;
17+ reiserfs_warning("reiserfs: wrong version/magic combination in the super-block\n") ;
18+ goto error ;
19+ }
20
21 journal_begin(&th, s, 1) ;
22 reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1) ;
23
24 rs->s_state = cpu_to_le16 (REISERFS_ERROR_FS);
25
26- if (strncmp (rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
27- strlen ( REISER2FS_SUPER_MAGIC_STRING))) {
28- if (le16_to_cpu(rs->s_version) != 0)
29- BUG ();
30+ if ( old_magic ) {
31 // filesystem created under 3.5.x found
32 if (!old_format_only (s)) {
33 reiserfs_warning("reiserfs: converting 3.5.x filesystem to the new format\n") ;
34Only in linux-2.4.7-pre9.patched/fs/reiserfs: super.c.orig
This page took 0.052472 seconds and 4 git commands to generate.