Unverified Commit 6b9cf668 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11078 nilfs2: fix general protection fault in nilfs_btree_insert()

parents cdf6c838 9d99ea33
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -478,9 +478,18 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
	ret = nilfs_btnode_submit_block(btnc, ptr, 0, REQ_OP_READ, 0, &bh,
					&submit_ptr);
	if (ret) {
		if (ret != -EEXIST)
			return ret;
		if (likely(ret == -EEXIST))
			goto out_check;
		if (ret == -ENOENT) {
			/*
			 * Block address translation failed due to invalid
			 * value of 'ptr'.  In this case, return internal code
			 * -EINVAL (broken bmap) to notify bmap layer of fatal
			 * metadata corruption.
			 */
			ret = -EINVAL;
		}
		return ret;
	}

	if (ra) {