Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc67e473 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: swap_ratio: bail out if there aren't any other swap device"

parents 53650353 f7b5aeaa
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -88,6 +88,12 @@ static int swap_ratio_slow(struct swap_info_struct **si)
	n = plist_next_entry(&(*si)->avail_list,
			struct swap_info_struct,
			avail_list);
	if (n == *si) {
		/* No other swap device */
		ret = -ENODEV;
		goto skip;
	}

	spin_unlock(&swap_avail_lock);
	spin_lock(&n->lock);
	spin_lock(&swap_avail_lock);
@@ -182,6 +188,9 @@ void setup_swap_ratio(struct swap_info_struct *p, int prio)

int swap_ratio(struct swap_info_struct **si)
{
	if (!sysctl_swap_ratio_enable)
		return -ENODEV;

	if (is_swap_ratio_group((*si)->prio))
		return swap_ratio_slow(si);
	else