Unverified Commit 37183a3b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 2a231005 d6e3b870
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -68,8 +68,12 @@ static int read_block_bitmap(struct super_block *sb,
	}

	for (i = 0; i < count; i++)
		if (udf_test_bit(i + off, bh->b_data))
		if (udf_test_bit(i + off, bh->b_data)) {
			bitmap->s_block_bitmap[bitmap_nr] =
							ERR_PTR(-EFSCORRUPTED);
			brelse(bh);
			return -EFSCORRUPTED;
		}
	return 0;
}

@@ -85,8 +89,15 @@ static int __load_block_bitmap(struct super_block *sb,
			  block_group, nr_groups);
	}

	if (bitmap->s_block_bitmap[block_group])
	if (bitmap->s_block_bitmap[block_group]) {
		/*
		 * The bitmap failed verification in the past. No point in
		 * trying again.
		 */
		if (IS_ERR(bitmap->s_block_bitmap[block_group]))
			return PTR_ERR(bitmap->s_block_bitmap[block_group]);
		return block_group;
	}

	retval = read_block_bitmap(sb, bitmap, block_group, block_group);
	if (retval < 0)
+2 −1
Original line number Diff line number Diff line
@@ -266,6 +266,7 @@ static void udf_sb_free_bitmap(struct udf_bitmap *bitmap)
	int nr_groups = bitmap->s_nr_groups;

	for (i = 0; i < nr_groups; i++)
		if (!IS_ERR_OR_NULL(bitmap->s_block_bitmap[i]))
			brelse(bitmap->s_block_bitmap[i]);

	kvfree(bitmap);