diff options
author | Christoph Hellwig <hch@lst.de> | 2009-02-04 03:33:58 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-02-04 03:33:58 -0500 |
commit | b93b6e434c046459cf3111c76dce46ba4abcb2b6 (patch) | |
tree | 04277a4f1bae95d38ea775623db3aaac72d56f26 /fs/xfs/xfs_mount.c | |
parent | f9057e3da79d18fdbd9d6adbb183f032c614feeb (diff) |
xfs: make sure to free the real-time inodes in the mount error path
When mount fails after allocating the real-time inodes we currently leak
them. Add a new helper to free the real-time inodes which can be used by
both the mount and unmount path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 86ac80c897c3..664961e45e02 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -1138,7 +1138,7 @@ xfs_mountfs( | |||
1138 | error = xfs_mount_log_sb(mp, mp->m_update_flags); | 1138 | error = xfs_mount_log_sb(mp, mp->m_update_flags); |
1139 | if (error) { | 1139 | if (error) { |
1140 | cmn_err(CE_WARN, "XFS: failed to write sb changes"); | 1140 | cmn_err(CE_WARN, "XFS: failed to write sb changes"); |
1141 | goto out_rele_rip; | 1141 | goto out_rtunmount; |
1142 | } | 1142 | } |
1143 | } | 1143 | } |
1144 | 1144 | ||
@@ -1147,7 +1147,7 @@ xfs_mountfs( | |||
1147 | */ | 1147 | */ |
1148 | error = XFS_QM_INIT(mp, "amount, "aflags); | 1148 | error = XFS_QM_INIT(mp, "amount, "aflags); |
1149 | if (error) | 1149 | if (error) |
1150 | goto out_rele_rip; | 1150 | goto out_rtunmount; |
1151 | 1151 | ||
1152 | /* | 1152 | /* |
1153 | * Finish recovering the file system. This part needed to be | 1153 | * Finish recovering the file system. This part needed to be |
@@ -1157,7 +1157,7 @@ xfs_mountfs( | |||
1157 | error = xfs_log_mount_finish(mp); | 1157 | error = xfs_log_mount_finish(mp); |
1158 | if (error) { | 1158 | if (error) { |
1159 | cmn_err(CE_WARN, "XFS: log mount finish failed"); | 1159 | cmn_err(CE_WARN, "XFS: log mount finish failed"); |
1160 | goto out_rele_rip; | 1160 | goto out_rtunmount; |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | /* | 1163 | /* |
@@ -1165,7 +1165,7 @@ xfs_mountfs( | |||
1165 | */ | 1165 | */ |
1166 | error = XFS_QM_MOUNT(mp, quotamount, quotaflags); | 1166 | error = XFS_QM_MOUNT(mp, quotamount, quotaflags); |
1167 | if (error) | 1167 | if (error) |
1168 | goto out_rele_rip; | 1168 | goto out_rtunmount; |
1169 | 1169 | ||
1170 | /* | 1170 | /* |
1171 | * Now we are mounted, reserve a small amount of unused space for | 1171 | * Now we are mounted, reserve a small amount of unused space for |
@@ -1189,6 +1189,8 @@ xfs_mountfs( | |||
1189 | 1189 | ||
1190 | return 0; | 1190 | return 0; |
1191 | 1191 | ||
1192 | out_rtunmount: | ||
1193 | xfs_rtunmount_inodes(mp); | ||
1192 | out_rele_rip: | 1194 | out_rele_rip: |
1193 | IRELE(rip); | 1195 | IRELE(rip); |
1194 | out_log_dealloc: | 1196 | out_log_dealloc: |
@@ -1219,10 +1221,7 @@ xfs_unmountfs( | |||
1219 | */ | 1221 | */ |
1220 | XFS_QM_UNMOUNT(mp); | 1222 | XFS_QM_UNMOUNT(mp); |
1221 | 1223 | ||
1222 | if (mp->m_rbmip) | 1224 | xfs_rtunmount_inodes(mp); |
1223 | IRELE(mp->m_rbmip); | ||
1224 | if (mp->m_rsumip) | ||
1225 | IRELE(mp->m_rsumip); | ||
1226 | IRELE(mp->m_rootip); | 1225 | IRELE(mp->m_rootip); |
1227 | 1226 | ||
1228 | /* | 1227 | /* |