Whamcloud - gitweb
LU-6961 ldiskfs: buffer head leak in mmp
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles11sp3 / ext4-mmp-brelse.patch
1 --- linux-stage.orig/fs/ext4/mmp.c      2015-11-01 15:42:38.069175571 +0530
2 +++ linux-stage/fs/ext4/mmp.c   2015-11-01 15:46:53.840174791 +0530
3 @@ -59,8 +59,11 @@
4         }
5  
6         mmp = (struct mmp_struct *)((*bh)->b_data);
7 -       if (le32_to_cpu(mmp->mmp_magic) != EXT4_MMP_MAGIC)
8 +       if (le32_to_cpu(mmp->mmp_magic) != EXT4_MMP_MAGIC) {
9 +               brelse(*bh);
10 +               *bh = NULL;
11                 return -EINVAL;
12 +       }
13  
14         return 0;
15  }
16 @@ -178,6 +180,7 @@
17                                              "The filesystem seems to have been"
18                                              " multiply mounted.");
19                                 ext4_error(sb, "abort");
20 +                               put_bh(bh_check);
21                                 goto failed;
22                         }
23                         put_bh(bh_check);