@@ -1922,21 +1922,20 @@ static void ocfs2_dismount_volume(struct
ocfs2_purge_refcount_trees(osb);
/* No cluster connection means we've failed during mount, so skip
- * all the steps which depended on that to complete. */
- if (osb->cconn) {
+ * all the steps which depended on that to complete.
+ * to fix resource leaks and avoid call sb_getblk again, mount can't return*/
+ if (!mnt_err && osb->cconn) {
tmp = ocfs2_super_lock(osb, 1);
if (tmp < 0) {
mlog_errno(tmp);
- return;
+ } else {
+ if (osb->slot_num != OCFS2_INVALID_SLOT)
+ ocfs2_put_slot(osb);
+
+ ocfs2_super_unlock(osb, 1);
}
}
- if (osb->slot_num != OCFS2_INVALID_SLOT)
- ocfs2_put_slot(osb);
-
- if (osb->cconn)
- ocfs2_super_unlock(osb, 1);
-
ocfs2_release_system_inodes(osb);
/*