From mboxrd@z Thu Jan 1 00:00:00 1970 From: thibaut@sautereau.fr (Thibaut SAUTEREAU) Date: Tue, 17 Oct 2017 10:54:48 +0700 Subject: A question on vma_address() In-Reply-To: <15f25e507d6.12927547e3137.3117448538573306284@zoho.com> References: <15f25e507d6.12927547e3137.3117448538573306284@zoho.com> Message-ID: <20171017035445.GC734@gandi.net> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Perr, On Mon, Oct 16, 2017 at 11:54:47PM +0800, Perr Zhang wrote: > Why should we use the function max() on 'start' and 'vma->vm_start'? > Could the 'start' be less than 'vma->vm_start'? If it is so, isn't it > wrong to just return vma->vm_start but report an error? The vma_address() function was recently changed in commit a8fa41ad2f6f7. In the previous version, having the return value of __vma_address() lower than vma->vm_start was actually triggering a VM_BUG_ON_VMA. Taking a look at this commit and understanding why such changes had to be done might help you find an answer to your question :) -- Thibaut SAUTEREAU