Whamcloud - gitweb
Branch b1_8
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-check-jbd-errors-2.6-sles10.patch
1 Index: linux-stage/include/linux/ext3_fs.h
2 ===================================================================
3 --- linux-stage.orig/include/linux/ext3_fs.h
4 +++ linux-stage/include/linux/ext3_fs.h
5 @@ -921,6 +921,7 @@ extern unsigned ext3_list_backups(struct
6                                   unsigned *five, unsigned *seven);
7  
8  /* super.c */
9 +extern void ext3_commit_super (struct super_block *, struct ext3_super_block *, int);
10  extern void ext3_error (struct super_block *, const char *, const char *, ...)
11         __attribute__ ((format (printf, 3, 4)));
12  extern void __ext3_std_error (struct super_block *, const char *, int);
13 Index: linux-stage/fs/ext3/super.c
14 ===================================================================
15 --- linux-stage.orig/fs/ext3/super.c
16 +++ linux-stage/fs/ext3/super.c
17 @@ -47,9 +47,6 @@ static int ext3_load_journal(struct supe
18                              unsigned long journal_devnum);
19  static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
20                                int);
21 -static void ext3_commit_super (struct super_block * sb,
22 -                              struct ext3_super_block * es,
23 -                              int sync);
24  static void ext3_mark_recovery_complete(struct super_block * sb,
25                                         struct ext3_super_block * es);
26  static void ext3_clear_journal_err(struct super_block * sb,
27 @@ -2175,7 +2172,7 @@ static int ext3_create_journal(struct su
28         return 0;
29  }
30  
31 -static void ext3_commit_super (struct super_block * sb,
32 +void ext3_commit_super (struct super_block * sb,
33                                struct ext3_super_block * es,
34                                int sync)
35  {
36 Index: linux-stage/fs/ext3/namei.c
37 ===================================================================
38 --- linux-stage.orig/fs/ext3/namei.c
39 +++ linux-stage/fs/ext3/namei.c
40 @@ -1591,7 +1591,7 @@ static int ext3_delete_entry (handle_t *
41                               struct buffer_head * bh)
42  {
43         struct ext3_dir_entry_2 * de, * pde;
44 -       int i;
45 +       int i, err;
46  
47         i = 0;
48         pde = NULL;
49 @@ -1601,7 +1601,9 @@ static int ext3_delete_entry (handle_t *
50                         return -EIO;
51                 if (de == de_del)  {
52                         BUFFER_TRACE(bh, "get_write_access");
53 -                       ext3_journal_get_write_access(handle, bh);
54 +                       err = ext3_journal_get_write_access(handle, bh);
55 +                       if (err)
56 +                               return err;
57                         if (pde)
58                                 pde->rec_len =
59                                         cpu_to_le16(le16_to_cpu(pde->rec_len) +
60 Index: linux-stage/fs/ext3/inode.c
61 ===================================================================
62 --- linux-stage.orig/fs/ext3/inode.c
63 +++ linux-stage/fs/ext3/inode.c
64 @@ -1838,8 +1838,18 @@ ext3_clear_blocks(handle_t *handle, stru
65                 ext3_mark_inode_dirty(handle, inode);
66                 ext3_journal_test_restart(handle, inode);
67                 if (bh) {
68 +                       int err;
69                         BUFFER_TRACE(bh, "retaking write access");
70 -                       ext3_journal_get_write_access(handle, bh);
71 +                       err = ext3_journal_get_write_access(handle, bh);
72 +                       if (err) {
73 +                               struct super_block *sb = inode->i_sb;
74 +                               struct ext3_super_block *es = EXT3_SB(sb)->s_es;
75 +                               printk (KERN_CRIT"EXT3-fs: can't continue truncate\n");
76 +                               EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS;
77 +                               es->s_state |= cpu_to_le16(EXT3_ERROR_FS);
78 +                               ext3_commit_super(sb, es, 1);
79 +                               return;
80 +                       }
81                 }
82         }
83