[Top] [All Lists]

Re: [PATCH 1/6] xfs: Fix m_agirotor reset during AG selection

To: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Subject: Re: [PATCH 1/6] xfs: Fix m_agirotor reset during AG selection
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Wed, 26 Sep 2012 15:19:53 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1348147961-7520-2-git-send-email-cmaiolino@xxxxxxxxxx>
References: <1348147961-7520-1-git-send-email-cmaiolino@xxxxxxxxxx> <1348147961-7520-2-git-send-email-cmaiolino@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 09/20/12 08:32, Carlos Maiolino wrote:
xfs_ialloc_next_ag() currently resets m_agirotor when it is equal to m_maxagi:

          if (++mp->m_agirotor == mp->m_maxagi)
                 mp->m_agirotor = 0;

But, if for some reason mp->m_maxagi changes to a lower value than current
m_agirotor, this condition will never be true, causing m_agirotor to exceed the
maximum allowed value (m_maxagi).

This implies mainly during lookups for xfs_perag structs in its radix tree,
since the agno value used for the lookup is based on m_agirotor. An out-of-range
m_agirotor may cause a lookup failure which in case will return NULL.

As an example, the value of m_maxagi is decreased during inode64->inode32
remount process, case where I've found this problem.

Signed-off-by: Carlos Maiolino<cmaiolino@xxxxxxxxxx>

Looks good.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>