Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'jfs-5.16' of git://github.com/kleikamp/linux-shaggy

Pull jfs fix from David Kleikamp:
"Just one JFS patch"

* tag 'jfs-5.16' of git://github.com/kleikamp/linux-shaggy:
JFS: fix memleak in jfs_mount

+22 -29
+22 -29
fs/jfs/jfs_mount.c
··· 81 81 * (initialize mount inode from the superblock) 82 82 */ 83 83 if ((rc = chkSuper(sb))) { 84 - goto errout20; 84 + goto out; 85 85 } 86 86 87 87 ipaimap = diReadSpecial(sb, AGGREGATE_I, 0); 88 88 if (ipaimap == NULL) { 89 89 jfs_err("jfs_mount: Failed to read AGGREGATE_I"); 90 90 rc = -EIO; 91 - goto errout20; 91 + goto out; 92 92 } 93 93 sbi->ipaimap = ipaimap; 94 94 ··· 99 99 */ 100 100 if ((rc = diMount(ipaimap))) { 101 101 jfs_err("jfs_mount: diMount(ipaimap) failed w/rc = %d", rc); 102 - goto errout21; 102 + goto err_ipaimap; 103 103 } 104 104 105 105 /* ··· 108 108 ipbmap = diReadSpecial(sb, BMAP_I, 0); 109 109 if (ipbmap == NULL) { 110 110 rc = -EIO; 111 - goto errout22; 111 + goto err_umount_ipaimap; 112 112 } 113 113 114 114 jfs_info("jfs_mount: ipbmap:0x%p", ipbmap); ··· 120 120 */ 121 121 if ((rc = dbMount(ipbmap))) { 122 122 jfs_err("jfs_mount: dbMount failed w/rc = %d", rc); 123 - goto errout22; 123 + goto err_ipbmap; 124 124 } 125 125 126 126 /* ··· 139 139 if (!ipaimap2) { 140 140 jfs_err("jfs_mount: Failed to read AGGREGATE_I"); 141 141 rc = -EIO; 142 - goto errout35; 142 + goto err_umount_ipbmap; 143 143 } 144 144 sbi->ipaimap2 = ipaimap2; 145 145 ··· 151 151 if ((rc = diMount(ipaimap2))) { 152 152 jfs_err("jfs_mount: diMount(ipaimap2) failed, rc = %d", 153 153 rc); 154 - goto errout35; 154 + goto err_ipaimap2; 155 155 } 156 156 } else 157 157 /* Secondary aggregate inode table is not valid */ ··· 168 168 jfs_err("jfs_mount: Failed to read FILESYSTEM_I"); 169 169 /* open fileset secondary inode allocation map */ 170 170 rc = -EIO; 171 - goto errout40; 171 + goto err_umount_ipaimap2; 172 172 } 173 173 jfs_info("jfs_mount: ipimap:0x%p", ipimap); 174 174 ··· 178 178 /* initialize fileset inode allocation map */ 179 179 if ((rc = diMount(ipimap))) { 180 180 jfs_err("jfs_mount: diMount failed w/rc = %d", rc); 181 - goto errout41; 181 + goto err_ipimap; 182 182 } 183 183 184 - goto out; 184 + return rc; 185 185 186 186 /* 187 187 * unwind on error 188 188 */ 189 - errout41: /* close fileset inode allocation map inode */ 189 + err_ipimap: 190 + /* close fileset inode allocation map inode */ 190 191 diFreeSpecial(ipimap); 191 - 192 - errout40: /* fileset closed */ 193 - 192 + err_umount_ipaimap2: 194 193 /* close secondary aggregate inode allocation map */ 195 - if (ipaimap2) { 194 + if (ipaimap2) 196 195 diUnmount(ipaimap2, 1); 196 + err_ipaimap2: 197 + /* close aggregate inodes */ 198 + if (ipaimap2) 197 199 diFreeSpecial(ipaimap2); 198 - } 199 - 200 - errout35: 201 - 202 - /* close aggregate block allocation map */ 200 + err_umount_ipbmap: /* close aggregate block allocation map */ 203 201 dbUnmount(ipbmap, 1); 202 + err_ipbmap: /* close aggregate inodes */ 204 203 diFreeSpecial(ipbmap); 205 - 206 - errout22: /* close aggregate inode allocation map */ 207 - 204 + err_umount_ipaimap: /* close aggregate inode allocation map */ 208 205 diUnmount(ipaimap, 1); 209 - 210 - errout21: /* close aggregate inodes */ 206 + err_ipaimap: /* close aggregate inodes */ 211 207 diFreeSpecial(ipaimap); 212 - errout20: /* aggregate closed */ 213 - 214 - out: 215 - 208 + out: 216 209 if (rc) 217 210 jfs_err("Mount JFS Failure: %d", rc); 218 211