@@ -503,15 +503,6 @@ static int release_orphan_inodes(e2fsck_t ctx)
!ext2fs_has_feature_orphan_present(fs->super))
return 0;
- clear_problem_context(&pctx);
- ino = fs->super->s_last_orphan;
- pctx.ino = ino;
- pctx.errcode = e2fsck_read_all_quotas(ctx);
- if (pctx.errcode) {
- fix_problem(ctx, PR_0_QUOTA_INIT_CTX, &pctx);
- return 1;
- }
-
/*
* Win or lose, we won't be using the head of the orphan inode
* list again.
@@ -525,10 +516,18 @@ static int release_orphan_inodes(e2fsck_t ctx)
* be running a full e2fsck run anyway... We clear orphan file contents
* after filesystem is checked to avoid clearing someone else's data.
*/
- if (fs->super->s_state & EXT2_ERROR_FS) {
- if (ctx->qctx)
- quota_release_context(&ctx->qctx);
+ if (fs->super->s_state & EXT2_ERROR_FS)
return 0;
+
+ e2fsck_read_bitmaps(ctx);
+
+ clear_problem_context(&pctx);
+ ino = fs->super->s_last_orphan;
+ pctx.ino = ino;
+ pctx.errcode = e2fsck_read_all_quotas(ctx);
+ if (pctx.errcode) {
+ fix_problem(ctx, PR_0_QUOTA_INIT_CTX, &pctx);
+ return 1;
}
if (ino && ((ino < EXT2_FIRST_INODE(fs->super)) ||
@@ -539,7 +538,6 @@ static int release_orphan_inodes(e2fsck_t ctx)
block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 4,
"block iterate buffer");
- e2fsck_read_bitmaps(ctx);
/* First process orphan list */
while (ino) {